In this article
Get Token
This endpoint is used to get Authorization tokens to access all other endpoints of the Digital Vault. Users, Devices, and Client Credentials all use this endpoint to get their access tokens.
URL
https://{{HOST}}/idm/ims/connect/token
Method
POST
Request Header Parameters
| Type | Value | Description |
|---|---|---|
| Authentication required |
Basic {basic-auth} | Base64 encoding of the clientid:clientsecret |
| Content-type required |
application/x-www-form-urlencoded |
Request Body Parameters
| Name | Description | Type |
|---|---|---|
| grant_type required |
Type of client for access token | string |
| scope required |
Scopes required for the new access token | string |
| username required for resource owner |
The user id that will be logging in | string |
| password requreid for resource owner |
The password of the user logging in | string |
Example
Request
Client Credentials
curl -X POST
'https://{{HOST}}/idm/ims/connect/token'
-H 'Authorization: Basic {basic-auth}'
-H 'content-type: application/x-www-form-urlencoded'
-d 'grant_type=client_credentials&scope=read write'
Resource Owner
curl -X POST
'https://{{HOST}}/idm/ims/connect/token'
-H 'Authorization: Basic {basic-auth}'
-H 'content-type: application/x-www-form-urlencoded'
-d 'grant_type=password&scope=read write&username=exampleuser&password=secret'
Response
{
"access_token": "<encoded token>",
"expires_in": 3600,
"token_type": "Bearer"
}
Errors
| Error | Description |
|---|---|
| invalid_client | There is an issue with either your client id or client secret, The format for the ‘Authorization’ header is “Basic base64Encode(clientid:clientsecrect)” |
| invalid_grant | There is most likely an issue with with your username or password |
| invalid_scope | You have asked for a scope that your client id doesn’t have permissions to give |
| unauthorized_client | Most likely there is an issue with your grant_type |
Response Body Parameters
| Name | Description | Schema |
|---|---|---|
| access_token | Encoded access token uses to authenticate requests | access token |
| expires_in | Time until token expires in seconds | number |
| token_type | The type of access token returned | string |