Authentication

Make a call to the Authentication API

This API handles obtaining an access token for authentication

POST https://sandbox.interswitchng.com/passport/oauth/token

Access tokens for all grant types can be obtained from the following URL:

Headers
The Authentication API endpoints require a Basic authorization header. In addition, the request body is sent as a URL-encoded form. As a result, the following headers would be set:

Authorization:

Basic <Base64Encoded string of client_id:client_secret>

Content-Type:

application/x-www-form-URL-encoded

Client Credentials Grant Type
Use this endpoint to get an access token using client credentials\

FieldTypeRequired
grant_typeStringRequired
scopeStringOptional

Sample Request Body

grant_type=client_credentials&scope=profile
FieldDescription
access_tokenThe access token that would be used to consume the secure APIs
expires_inThe time this token will expire in seconds. Ensure that the token is renewed at least 30 seconds before the token expires to prevent expiry in flight
{
  "access_token": "eyJhbGciOiJSUzI1NiJ9.eyJhdWQiOlsicGFzc3BvcnQiXSwic2NvcGUiOlsicHJvZmlsZSJdLCJleHAiOjMwMTg1Mjk4ODksImp0aSI6IjBlYWYwMWIzLTM4M2QtNDFkNi1hOTgzLWI3OTIwNDU3ODBjMyIsImNsaWVudF9pZCI6InRlc3RjbGllbnQifQ.OaLlGSTLFHGu7553HNhzuBOIiQvdiNVNPAm5-opCq7JPugEG2ubPtLZLu2znr0aJkHR0BGiV2e9ZSrkp6cxYoT74
}
{"error": "invalid_request","error_description": "Missing grant type"}