Skip to content

Client Credentials Grant

The client credentials grant is suitable for machine-to-machine authentication or for clients making requests to an API that does not require the user’s permission. For example, application developers can use this grant type to remotely authenticate applications. Only trusted clients must be allowed to use this grant type.

In this grant type, the client requests an access token using only the client credentials to authenticate a request for an access token. This does not have support for the refresh token grant.

Here are the cURL commands to use the client credentials grant:

curl -v -X POST -H "Authorization: Basic <base64 encoded client id:client secret value>" -k -d "grant_type=client_credentials&validity_period=3600" -H "Content-Type:application/x-www-form-urlencoded"
curl -u <client id>:<client secret> -k -d "grant_type=client_credentials&validity_period=3600" -H "Content-Type:application/x-www-form-urlencoded"

You will receive a response similar to the following: