How to get an Auth0 token?
As an API consumer, you want to get an Auth0 token you wonder what you must do? Here are the very main step to follow and some code example that you can reuse on your own to do so.
Summary
cURL example with 2 scopes requested
Using the following two scopes:
- urn:axa.partners.sales.individual.travel.policies.write
- urn:axa.partners.sales.individual.travel.quotesrequests.write
The cURL command line should look like:
curl -X POST \
https://auth.api.axapartners.com/oauth/token \
-H 'authorization: Basic NDAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxXXXxxxxxxxxxxxxiMTg=' \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials&scope=urn%3Aaxa.partners.sales.individual.travel.policies.write%20urn%3Aaxa.partners.sales.individual.travel.quotesrequests.write'
Token answer example
When the request succeeded, the response from the authorization server should look like:
{
"access_token": "eyJ0xxx[...]xxxxxaWbNLmg4bA5X-ruhRZb5ZUisssApQBFL_0usUfTfg",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "urn:axa.partners.sales.individual.travel.policies.write urn:axa.partners.sales.individual.travel.quotesrequests.write"
}