Authentication#
Our API utilizes JSON Web Tokens (JWT) for secure authentication. This approach ensures efficient and reliable access to our services while maintaining strong security standards.We offer two methods for obtaining a token, allowing flexibility based on your integration needs.Our tokens are signed with the HMAC256 algorithm.
Token Generation via API#
Simply send your clientId and secret in the API request, and the endpoint will return a token valid for 1 hour.{
"clientId": "DragonPass",
"secret": "dpSecretKey12345"
}
JWT Self-Generation#
Clients have the flexibility to generate their own JWTs using their preferred tools.1. Account Setup and Credential Generation#
When you are ready to connect to our sandbox environment, DragonPass will help to setup the account, which includes necessary credentials to generate production JWTs.Unique Program ID: 18943
Each client will be assigned a unique identifier, which is used to track and manage API usage.
Issuer (iss): 6A909655CF67444A93262A665CDD235F
A unique issuer identifier will be assigned to your account. This identifier must be used when generating JWTs to ensure they are valid for API endpoints.
Secret Key: 60B118779DD14B0990692B51BF8B93DC
A new, unique secret key will be generated for your account. This key is used to sign the JWTs, ensuring that they are secure and have not been tampered with.
2. Token Creation#
Step 1: Prepare Your JWT Generation Code
To generate a JWT, you'll need to use a library that supports JWT creation and validation. You can visit jwt.io to find libraries and examples specific to your programming environment.Step 2: Set the Expiration Time and Generate the TokenOnce you have your JWT library installed, you will need to set the expiration time for the token, and use the issuer and secret provided by us to sign the token.The token is signed using the HMAC256 algorithm.Please ensure that you securely store the secret key and do not expose it in your client-side code.3. Example Snippet (Java)#