Obtain and renew the bearer token that authenticates an API integration on the FinologeeBKO API.
Every call to the FinologeeBKO API carries a bearer token in the Authorization header. An integration obtains the token from the Finologee identity provider with the OAuth 2.0 password grant, using the credentials of an API integration of the tenant, and renews it with the refresh token grant.
The token identifies the API integration and the tenant. Every call then runs under the rights of that API integration: see Getting started.
Key concepts
- API integration: a technical user of the tenant that an external system uses to call the API. Tenant administrators create it in Tenant settings > API integrations and assign its permissions. See API integrations
username: the ID of the API integration, in the form<24 lowercase letters and digits>@<suffix>, for example[email protected]password: the secret key of the API integration. FinologeeBKO displays it once, when the API integration is created or reactivated, or when the key is regeneratedclient_id: the identifier of the tenant at the identity provider. Finologee provides it with the tenant
Supported grant types
The token endpoint accepts only the password and refresh_token grant types for FinologeeBKO, as described on Get an access token. The client_credentials grant is not available: an API integration always authenticates with its ID and secret key.
Using the token
Send the access token in every FinologeeBKO API call:
Authorization: Bearer <access_token>
FinologeeBKO checks the following on every call, and answers 401 when one of them fails:
- The token signature, issuer and expiry are valid
- The token was issued for the
client_idof an active tenant, and the call goes to the host of that tenant - The API integration exists in the tenant and is active. Tokens issued before a deactivation stop working at once
A token of an API integration without any right is rejected.
Token lifetime
Read expires_in and refresh_expires_in from each response rather than hard-coding them. Request a new access token before expires_in elapses; when the refresh token has also expired, authenticate again with grant_type=password.
Credential rotation
- Regenerating the secret key in Tenant settings makes the previous key stop working immediately. Update the external system with the new key before the next
passwordgrant - Reactivating a deactivated API integration issues a new secret key, because the previous key no longer works
- A new or reactivated API integration can obtain a token only once it is active, which requires an approval when the tenant uses the tenant settings approval workflow
- Store the secret key in the credential store of the external system

