
fvia9 (fvia9) asked a question.
Hi, I would like to use the Bearer access token from the Client Credentials flow in a request to list groups but keep running into an error that "The access token is invalid."
This is how I get the token:
curl --request POST --url ${okta_auth_endpoint}/token --header 'accept: application/json' --header 'authorization: Basic MG9BLAHBLAHBLAHndyaA==' --header 'cache-control: no-cache' --header 'content-type: application/x-www-form-urlencoded' --data 'grant_type=client_credentials&scope=default'
{"token_type":"Bearer","expires_in":3600,"access_token":"eyJraWBLAHBLAHBLAHBLAHKiEy5A","scope":"default"}
When I attempt to use the token:
curl -v -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer eyJraWBLAHBLAHBLAHBLAHKiEy5A" "https://dev-id.mysafelite.net/api/v1/groups?search=profile.name+eq+%22Org-Test-Group%22"
I end up receiving a 401/Unauthorized.
www-authenticate: Bearer authorization_uri="http://dev-id.mysafelite.net/oauth2/v1/authorize", realm="http://dev-id.mysafelite.net", scope="okta.groups.read", error="invalid_token", error_description="The access token is invalid.", resource="/api/v1/groups"
