<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00006uQ0zICASOkta Classic EngineAdministrationUnanswered2021-04-07T00:28:39.000Z2021-04-07T00:28:39.000Z

fvia9 (fvia9) asked a question.

Using the Bearer access token from the Client Credentials flow

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"


This question is closed.
Loading
Using the Bearer access token from the Client Credentials flow