How To: Perform OAuth Client Credentials Grant

This OAuth 2.0 flow is used by App's to get a token for API's that support app tokens.

Initiating the flow

To obtain an access token for the app, you initiate this flow by posting a request to the following url:

Example request

POST /{tenant}/oauth2/v1/token/ HTTP/1.1
Host: theidentityhub.com
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials
&client_id=[YOUR_CLIENT_ID]
&client_secret=[YOUR_CLIENT_SECRET]

Handling the response

After The Identity Hub authenticates your app using the provided App credentials, a json result will be returned containing the access token.

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache

{
    "access_token":"7779HHKHKHKK6683TY3",
    "token_type":"bearer",
    "expires_in":3600
}

Related sections

GET {tenant}/oauth2/v1/auth
POST {tenant}/oauth2/v1/token
GET {tenant}/oauth2/v1/verify