Skip to content

Authenticating via the client credentials method

Use Case

The client credentials method is strictly limited to server-to-server calls.

Authentication Steps

The client_credentials method allows access without requiring approval from an end user. This access is generic and non-personalized. Since there is no validation of a username and password combination, this method is limited to cases where the third party (your application) can securely store the application's registration data.

Here are the general steps:

  • Step 1: Provide the application's registration information.
  • Step 2: Receive an access token.

Step 1: Provide the application's credentials

Make a POST request to https://{api_base_url}/{client_token}/oauth/v2/token with the following parameters:

ParameterLocationDescription
api_base_urlQueryThe API URL you want to use. It varies depending on integration and production environments.
client_tokenQueryEach club chain has a Resamania identifier called client_token.
grant_typeBodyThe method name, which should be set to client_credentials.
client_idBodyEach registered application has an identifier with the OAuth server called client_id.
client_secretBodyEach registered application has a secret string with the OAuth server called client_secret.

Example Request

bash
curl --location 'https://{api_base_url}/{client_token}/oauth/v2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=123_xxxxxxxxxxxxxxxxx' \
--data-urlencode 'client_secret=******************' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'refresh_token=N2E2YzcwYWYxN...'

Step 2 - Receive the access token

The OAuth server API responds with the following information:

json5
{  
   "access_token":"{access_token}",
   "expires_in":{expires_in},
   "token_type":"bearer",
   "scope":{scope},
   "refresh_token":"{refresh_token}"
}
Parameterdescription
access_tokenThe JWT token required for any request to the Resamania API.
expires_inThe validity duration of the access token in seconds.
token_typeThe type of access token, which for Resamania is always Bearer
scopeThe specific scope(s) associated with the access token.
refresh_tokenThe new access renewal token.