Authenticate a client
Authenticating with your client details to retrieve an access token using OAuth 2.0
Now that you have created a client when you want to perform an API request, you must first authenticate and receive an OpenCRVS access token. The token endpoint is OAuth 2.0 compliant.
Client access tokens are valid for a maximum of 10 minutes. After it expires you must authenticate again to retrieve a new access token.
You can use our Postman collections to test all client functionality. Postman is a tool you can download to test API access before building your integrations.
URL
Request payload
Example URL
Query parameter | Sample value | Description |
---|---|---|
|
| The client id used in the authentication process for system clients. |
|
| The client secret used in the authentication process for system clients. |
|
| The only supported grant type is client_credentials |
Request Response
The token is a JWT containing with the following structure and must be included as a header:Authorization: Bearer <token>
in all future API requests. The content of an OpenCRVS access token looks like this:
Token Header
Parameter | Sample value | Description |
---|---|---|
|
| Signing algorithm. |
|
| This value is always |
Token Payload
Parameter | Sample value | Description |
---|---|---|
|
| An array of OpenCRVS roles for authorization permissions to access. These are defined as a feature of the OpenCRVS core. Approved scopes are |
|
| When the JWT was created. |
|
| When the JWT expires - For clients this is set to 10 minutes by default, but this is configurable in the resources package. |
|
| An array of services that will respond to this JWT. |
|
| The issuing service of the JWT. |
|
| A unique client id in our database. |