OAuth2 Authentication

Support DQE
Support DQE
  • Updated

Use OAuth2 to generate a temporary Bearer token before calling DQE APIs. The flow uses your licence code, client secret, and requested scope to return an access token with a limited validity period.

See also: OAuth2 Swagger documentation

GET request

Use this endpoint to generate an OAuth2 access token using the GET method.

Endpoint

https://{SERVER_ADDRESS}/oauth/access_token/?client_secret={CLIENT_SECRET}&scope={SCOPE}&client_id={LICENCE_CODE}

Replace the values in braces with your own information:

Parameter Value Description Mandatory/Optional
SERVER_ADDRESS {SERVER_ADDRESS} Address of the DQE server that will process the data. Mandatory
client_id {LICENCE_CODE} Number assigned to you as your licence code. Mandatory
client_secret {CLIENT_SECRET} Passphrase provided by DQE Software. Mandatory
scope {SCOPE}

Defines the requested authorization scope. Available values include:

  • client_address — DQE Address APIs
  • client_phone — DQE Phone APIs
  • client_email — DQE Email APIs
  • client_idcheck — DQE ID Check APIs
  • client_general — multiple DQE APIs
  • client_b2b — DQE B2B APIs
  • client_civility — DQE Name APIs
Mandatory

POST request

Use this endpoint to generate an OAuth2 access token using the POST method.

Endpoint

https://{SERVER_ADDRESS}/oauth/access_token/

Method: POST

Add the following parameters in the request body using x-www-form-urlencoded.

Parameter Value Description Mandatory/Optional
client_id {LICENCE_CODE} Number assigned to you as your licence code. Mandatory
client_secret {CLIENT_SECRET} Passphrase provided by DQE Software. Mandatory
scope {SCOPE}

Defines the requested authorization scope. Available values include:

  • client_address — DQE Address APIs
  • client_phone — DQE Phone APIs
  • client_email — DQE Email APIs
  • client_idcheck — DQE ID Check APIs
  • client_general — multiple DQE APIs
  • client_b2b — DQE B2B APIs
  • client_civility — DQE Name APIs
Mandatory

Response

Success response

If authentication succeeds, the API returns a JSON dictionary containing the following keys:

Key Description Type
access_token Temporary token used to call the service. STRING
token_type Bearer — authorized token type. STRING
expires_in Token validity period, in seconds. STRING
refresh_token Token used to extend your session. STRING

Example:

{
  "access_token": "TK948869a6f873adb622enhoaGeVY2iRaptqlmpplGeWZA",
  "token_type": "Bearer",
  "expires_in": "300",
  "refresh_token": "*TK9bdd05f8e9d3c905834bdeqaUlGFll2iRaplll29mZmtkZQ"
}

Error responses

Error type Request example Response type
Missing client_id parameter https://{SERVER_ADDRESS}/oauth/access_token/?client_secret=abcd&scope=client_address 400 Error (Invalid Request)
Empty client_id parameter https://{SERVER_ADDRESS}/oauth/access_token/?client_secret=abcd&scope=client_address&client_id= 400 Error (Invalid Request)
Incorrect client_id (expired, out of scope, or nonexistent) https://{SERVER_ADDRESS}/oauth/access_token/?client_secret=abcd&scope=client_address&client_id={INCORRECT_LICENCE_CODE} 400 Error (Invalid Client)
client_id does not authorize the requested scope https://{SERVER_ADDRESS}/oauth/access_token/?client_secret=abcd&scope=client_address&client_id={LICENCE_CODE_NOT_AUTHORIZED} 400 Error (Unauthorized Client)
Unknown scope parameter value https://{SERVER_ADDRESS}/oauth/access_token/?client_secret=abcd&scope=client&client_id={LICENCE_CODE} 400 Error (Unsupported Grant Type)
Missing or empty client_secret parameter https://{SERVER_ADDRESS}/oauth/access_token/?scope=client_address&client_id={LICENCE_CODE}
https://{SERVER_ADDRESS}/oauth/access_token/?client_secret=&scope=client_address&client_id={LICENCE_CODE}
400 Error (Invalid Request)
Missing or empty scope parameter https://{SERVER_ADDRESS}/oauth/access_token/?client_secret=abcd&client_id={LICENCE_CODE}
https://{SERVER_ADDRESS}/oauth/access_token/?client_secret=abcd&scope=&client_id={LICENCE_CODE}
400 Error (Invalid Request)
Parameter typo https://{SERVER_ADDRESS}/oauth/access_token/?client_scret=abcd&scope=client_address&client_id={LICENCE_CODE} 500 Error

Related to

Was this article helpful?

0 out of 0 found this helpful