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

Errors when Retrieving Jamf Pro API Endpoints #24

Closed
cpeonepeloton opened this issue Sep 30, 2022 · 2 comments
Closed

Errors when Retrieving Jamf Pro API Endpoints #24

cpeonepeloton opened this issue Sep 30, 2022 · 2 comments

Comments

@cpeonepeloton
Copy link

I run the kmart --json /Users/Shared/Kmart/config/config.json

┌───────────────────────────────────┐
 │ RETRIEVING JAMF PRO API ENDPOINTS │
└───────────────────────────────────┘
  ├─ Unable to find 'token' and 'expires' keys in URL response
  ├─ Buildings - The operation couldn’t be completed. (KMART.KmartError error 4.)
  ├─ 
  ├─ Unable to find 'token' and 'expires' keys in URL response
  ├─ Departments - The operation couldn’t be completed. (KMART.KmartError error 4.)
  ├─ 
  ├─ Unable to find 'token' and 'expires' keys in URL response
  ├─ eBooks - The operation couldn’t be completed. (KMART.KmartError error 4.)```

I have added the credentials correctly to the config.json would this happen if SSO is in place even if we have a username/password account in jamfcloud?
@ninxsoft
Copy link
Owner

ninxsoft commented Dec 25, 2022

Hi @cpeonepeloton, KMART uses your account's standard username and password to retrieve a bearer auth token via /v1/auth/tokens, which is then used for all subsequent API calls.

KMART.KmartError error 4 refers to 'token' and 'expires' keys missing from the JSON that was returned for the auth token, indicating the username and/or password may be incorrect.

See: Classic API Authentication Changes

In my testing, I am also able to confirm that I am receiving a HTTP 401 error every time I receive the Unable to find 'token' and 'expires' keys in URL response error message, which helps confirm an invalid username / password.

I don't suspect SSO is playing a part - as we're getting a response, just not the one we want.

Am I able to confirm your username and password are base64 encoded? You can convert to base64 via the following command:

printf 'username:password' | iconv --to-code ISO-8859-1 | base64

Note: This account should be an API account, and not one that is tied to SSO in anyway 👍

@ninxsoft
Copy link
Owner

Closing due to inactivity. Will re-open if required 👍

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