Overview
Nomba uses OAuth 2.0 to secure API access. You’ll use yourclient_id
and client_secret
to obtain an access_token
. To get the client credentials from the Nomba dashboard, follow the steps on how to obtain API keys.
The authentication flow has three key steps:
- Obtain an
access_token
andrefresh_token
- Refresh the token when it expires
- Revoke the token when no longer needed
Obtain Access Token
Use theclient_credentials
grant to request an access_token
and refresh_token
. The access_token
is required for making API requests.
Refresh Access Token
Access tokens expire after 30 minutes. Instead of requesting a new token with your credentials, exchange therefresh_token
for a new access_token
.
This avoids exposing your client_secret repeatedly and keeps the process secure.
We recommend refreshing your
access_token
at least 5 minutes before it expires.Revoke Access Token
Revoke anaccess_token
when you need to immediately terminate access.
This is useful if the token is compromised, expired, or no longer needed.
Once revoked, the token is invalid and cannot be used to access resources.
Authentication Best Practices
To keep your integration secure, follow these best practices:-
Never expose credentials (
client_id
,client_secret
,refresh_token
) in frontend code or public repositories. - Use secure storage for tokens in your backend (e.g., environment variables, encrypted storage).
- Refresh tokens proactively (5 minutes before expiry) instead of waiting until the last moment.
- Revoke tokens immediately if you suspect they’ve been leaked or compromised.
- Rotate credentials periodically and remove unused API keys.