Skip to content

Commit

Permalink
token is a different key too
Browse files Browse the repository at this point in the history
  • Loading branch information
jgarcesres authored Sep 18, 2023
1 parent c162f28 commit 12e0bb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion action.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ def get_jamf_token(url, auth_type, username, password):
if token_request.status_code == requests.codes.ok:
if auth_type == "auth":
logger.success(f"got the token! it expires in: {token_request.json()['expires']}")
token_request.json()['token']
elif auth_type == "oauth":
logger.success(f"got the token! it expires in: {token_request.json()['expires_in']}")
return token_request.json()['token']
token_request.json()['access_token']
elif token_request.status_code == requests.codes.not_found:
logger.error('failed to retrieve a valid token, please check the url')
raise Exception("failed to retrieve a valid token, please check the credentials")
Expand Down

0 comments on commit 12e0bb4

Please sign in to comment.