Authentication
There are two supported methods of authentication: API Key and token-based. API keys are simpler and are the original method of support, while token-based provides more granular permissions on an individual user basis.
Token Authentication
Token authentication is the recommended method of authentication. It provides more granular permissions on an individual user basis.
To use token-based authentication, you must first authenticate against the token endpoint using a given user.
POST: https://api.{ENV}.dais.com/ioi/v3/token
curl --location --request POST 'https://api.{ENV}.dais.com/ioi/v3/token' \ --data-raw '{ "userId": "<username>", "password": "<password>", "grantType": "PASSWORD" }'
The token-based authentication is still in beta and is subject to change. The current implementation requires a username and password to be passed in the body of the request. The response will contain an accessToken and an idToken that can be used to authenticate subsequent requests by including them in the headers as follows:
{ "Authorization": "Bearer <accessToken>", "x-jwt-assertion": "<idToken>" }
Basic Authentication
As basic auth uses a secret/key (username/password) combination, these can be created and managed under "Dev Tools > API Access Keys"
.
Remember that your API key is a secret! Do not share it with others or expose it in any client-side code (browsers, apps). Production requests must be routed through your own backend server where your API key can be securely loaded from an environment variable or key management service.
All API requests must include your API key in an Authorization
HTTP header as follows:
Basic <Base64 encoding of Api Key:Secret>
After encoding, it should look similar to this:
Authorization: Basic YmNkODQwM2QtMTVjMC00Njk2LTgxODYtZGI5YjAzYTY2MzY0OnF4T29XS3g5VG5yRnN3dndzWG9mN0laNA==
Say Hello
Verify that you are able to authenticate by hitting our test endpoint.
GET: https://api.{ENV}.dais.com/ioi/v3/hello
curl --location --request GET 'https://api.{ENV}.dais.com/ioi/v3/hello' \ --header 'Authorization: Basic <yourAuthHere>'
curl --location --request GET 'https://api.{ENV}.dais.com/ioi/v3/hello' \ --header 'Authorization: Bearer <accessToken>' --header 'x-jwt-assertion: <idToken'