Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Credentials - Failed to Auth #41

Open
ElliotWilde opened this issue Dec 5, 2024 · 1 comment
Open

API Credentials - Failed to Auth #41

ElliotWilde opened this issue Dec 5, 2024 · 1 comment

Comments

@ElliotWilde
Copy link

Possibly user error but when connecting using API credentials (ID:KEY), I keep getting 'Couldn't Authenticate with the credentials provided'

Screenshot 2024-12-04 235905

@jfretheim
Copy link
Contributor

jfretheim commented Dec 5, 2024

I'll preface this with saying: the documentation for this new version is still in the works (see #40), so definitely easy to miss part of the setup! That said, here are a couple things to try so we can troubleshoot.

Does the API Role for your API Client have the right privileges? Depending on the tables selected, it may need:

  • Read Mobile Devices
  • Read Computers
  • Read Smart Mobile Device Groups
  • Read Static Mobile Device Groups
  • Read Smart Computer Groups
  • Read Static Computer Groups

If the above checks out, are you able to obtain an access token with that client ID and secret using another tool (for example, Postman or curl)? Here's an example for curl that should point you in the right direction:

curl --location "$JAMF_PRO_URL"/api/v1/oauth/token \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "grant_type=client_credentials" \
  --data-urlencode "client_id=$CLIENT_ID" \
  --data-urlencode "client_secret=$CLIENT_SECRET"

This article has a nice "recipe" script with some sample code for obtaining an access token, as well: Jamf Pro API Docs - Client Credentials.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants