Some times, your application needs to access APIs on its own rights. Meaning that it's not on a user behalf.
To do so, CYM-Identity can generate access_token which belongs to the application itself.
Make sure that you have the following information :
  1. OpenID Provider Metadata (autodiscovery URL) : Your admin can provide you with the URL which lives in https://${realm.url}/oauth/${realm.name}/.well-known/openid-configuration
  2. Your client credentials : client_id & client_secret, or client_id & private key
This flow only applies to web applications. native apps cannot use this flow.

Token request

POST /token_endpoint HTTP/1.1
Host: oauth.server
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
&client_id=YOUR_CLIENT_ID
&client_secret=YOUR_CLIENT_SECRET
ParameterRequiredDescription
grant_typeYesThe value must be client_credentials
client_idYesThe identifier for your application
client_secretNoOnly required if the client authenticates through client_secret_post
client_assertionNoOnly required if the client authenticated through client_secret_jwt or private_key_jwt
client_assertion_typeNoOnly required if a client_assertion is used. The value must be urn:ietf:params:oauth:client-assertion-type:jwt-bearer

Token response

Error response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
{
"error": "AN_ERROR_CODE",
"error_description": "AN_ERROR_DESCRIPTION"
}

Successful response

HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
{
"access_token": "AN_ACCESS_TOKEN_VALUE",
"token_type": "Bearer",
"expires_in": 3600,
}
This flow does not return an id_token since it's not an authentication request.
This flow does not return a refresh_token either. In case you need a new access_token, you can reiterate a new Token Request