Skip to content

Renew Authentication with the refresh token Method

Use Case

This method is primarily intended for mobile applications.

Authentication Steps

This method does not allow authentication but only the renewal of an already acquired authentication. A prerequisite for using this method is to have previously used another method that generates a refresh token.

Here are the general steps:

  • Step 1: You provide the refresh token.
  • Step 2: You receive a new access token along with a new refresh token.

Step 1 - Provide the Refresh Token

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 wish to use. This varies depending on integration and production environments.
client_tokenQueryEach club group has a Resamania identifier called client_token.
grant_typeBodyThe method name, which should be set to refresh_token.
refresh_tokenBodyThe token used to renew access.
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=refresh_token' \
--data-urlencode 'refresh_token=N2E2YzcwYWYxN...'

Step 2 - Receive the Access Token

The OAuth server API will return the following response:

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 scopes related to the access token.
refresh_tokenThe new token used to renew access.