Authenticate
Learn how to obtain an access token to authenticate with IDnow
IDnow uses OAuth 2.0 with the client credentials grant type for API authentication. The steps to set up authentication are:
- Create API clients
- Use the obtained
client IDandclient secretto get anaccess token - Use the
access tokento make an authenticated API request
Obtain access token
Use your client ID and client secret to request an access token.
Request parameters
| Parameter | Description | Required |
|---|---|---|
grant_type | OAuth 2.0 grant type. Use client_credentials for server-to-server auth. | Yes |
client_id | Your API client ID from the IDnow dashboard. | Yes |
client_secret | Your API client secret from the IDnow dashboard. | Yes |
Explicit credentials (client_secret_post)
Include your credentials directly in the request body:
curl --request POST https://<your-idnow-auth-server>/oidc/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'grant_type=client_credentials' \
--data 'client_id=<your-client-id>' \
--data 'client_secret=<your-client-secret>' \
Response
If successful, you will receive an access token:
{
"access_token": "eyJh...QifQ.eyJ...hIOw",
"expires_in": 86400,
"token_type": "Bearer"
}
Note: The default
access tokenlifetime is typically 86400 seconds (24 hour). Cache tokens appropriately to avoid unnecessary requests.
Make an API request
Now that you have a valid access token, you can make requests to IDnow APIs. Include the access token in the Authorization header using the Bearer scheme:
GET /api/v1/<endpoint> HTTP/1.1
Host: <your-idnow-api-host>
Accept: application/json
Authorization: Bearer eyJh...QifQ.eyJ...hIOw
Example request
curl --request GET https://<your-idnow-api-host>/v1/flows/{flowId}/{environment}/sessions\
--header 'Accept: application/json' \
--header 'Authorization: Bearer eyJh...QifQ.eyJ...hIOw'