Login Info Grant
Some REST API endpoints require a user context. When calling these endpoints, a user’s access token must be provided.
Request an access token
Request an access token by providing a "login_info" object with a valid user credential.
Example request:
Endpoint:
POST /api/auth/token
Headers:
Content-Type:application/json
Body:
{
"grant_type": "login_info",
"scope": "{scopes}",
"client_id": "{app client_id}",
"client_secret": "{app secret}",
"login_info": {
"type": 2,
"pin": "{user pin}"
}
}
Login Info grant allows requests for access tokens by providing user credentials, however, it differs from the Password grant.
The Login Info request must contain a "login_info" object. This object allows login by using one of the valid user login options.
Here are login info object examples for each login type:
User Card |
CODE
|
User PIN |
CODE
|
User and Password |
CODE
|
Card and PIN |
CODE
|
Card and Password |
CODE
|
Retrieving an access token
If authentication is successful, you'll receive an access token that must be provided at any other API endpoint in the authorization header: Authorization: Bearer {{accessToken}}
.
Example Response:
{
"access_token": "{your_bearer_token}",
"token_type": "Bearer",
"expires_in": 1800,
"scope": "{granted scopes}",
"refresh_token": "{your_refresh_token}"
}