Clients can use this API to generate a JSON Web Token for secure access to all v3 APIs as an alternative to client_id & client_secret.
Clients can access all v3 Decentro APIs through two primary methods. Either method can be used to access the APIs. The available methods are:
- Client Credentials
- JWT tokens
1. Client Credentials
While you are onboarded on the Decentro environment by our team, you will receive the credentials for your company basis the modules you've chosen to go with. If you haven't got your credentials yet, you can get them by signing up here.
You'll get the below important credentials for each module that you choose -
Name | Description |
---|---|
client_id | This is a unique id assigned to each client |
client_secret | This is a client-specific password/secret_key to access the account |
Clients are required to pass client_id
and client_secret
in the headers to access the APIs.
Please note that the credentials are unique to a platform and should not be shared within the organization without consent or with any external partners.
2. JWT
JWT stands for JSON Web Token. It is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object.
- Customers can generate JWT using our Auth API with various grant types in the request body.
- Customers can pass the grant_type as
- client_credentials
- refresh_token
- The JWT token is valid for 15 minutes by default
Generate JWT with Client Credentials
Customers can generate JWT with Client Credentials -
Request Parameter | Description |
---|---|
grant_type | To generate JWT with client credentials, customers need to pass grant_type as client_credentials |
client_id | The client id generated for the customer at Decentro |
client_secret | The client secret generated for the customer at Decentro |
Generate JWT with Refresh Token
Customers can generate JWT with Refresh Token -
Request Parameter | Description |
---|---|
grant_type | To generate JWT with refresh token, customers need to pass grant_type as refresh_token |
refresh_token | The refresh token that was generated while creating JWT |
How to use JWT in Decentro APIs?
Once customers generate JWT, they can use this instead of client_id and client_secret in API Authorization.
- Customers can pass JWT in headers instead of client_id and client_secret to access the API.
- Customers should use 'Bearer token' as the Auth type.
- All our APIs will work with both the methods, Client Credentials, and JWT.