Перейти к основному содержанию
POST
/
oauth2
/
token
Get access token
curl --request POST \
  --url http://dev-backend-1.guestme.space/oauth2/token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials \
  --data scope=ROLE_EXTERNAL_INTEGRATION
{
  "scope": "ROLE_EXTERNAL_INTEGRATION",
  "access_token": "eyJhbGciOiJIUzUxMiJ9...",
  "token_type": "Bearer",
  "expires_in": 599
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Authorization
any
required

Basic base64(client_id:client_secret)

Body

application/x-www-form-urlencoded

Form for requesting access token using client_credentials

grant_type
string
required

OAuth2 grant type, must be 'client_credentials'

Example:

"client_credentials"

scope
string
required

Must be 'ROLE_EXTERNAL_INTEGRATION'

Example:

"ROLE_EXTERNAL_INTEGRATION"

Response

200 - application/json

Successful token response

access_token
string
scope
string
token_type
string
default:Bearer
expires_in
integer
I