Authentication
Environments
These are the URLs for the different authentication service environments:
- Production: https://health-passport.azurefd.net
- Testing: https://health-passport-homolog.azurefd.net
Contact our team to request your access credentials.
Creating a token
tip
The Token expires after 24 hours and can be reused in multiple requests during that period.
To create a token it is necessary send a POST
request to the /connect/token
endpoint.
Here is an example of a request to create a token:
curl --location --request POST 'https://health-passport-homolog.azurefd.net/connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=<client_id>' \
--data-urlencode 'client_secret=<client_secret>' \
--data-urlencode 'scopes=<scopes>' \
--data-urlencode 'grant_type=client_credentials'
Result
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"expires_in": 86400,
"token_type": "Bearer"
}
Using the token
To authenticate requests, simply add the generated token to the request header
, as follows:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Expiration
The token has a default validity of 24 hours. If an expired token is sent, a 401 error will be returned in the API call.