Concepts
| Client ID | The client_id is a globally unique identifier (GUID) that is the unique identifier for your application in DEXIS Active Directory. DEXIS service support should provide you with the its value during integration proccess. |
| Client Secret | The client_secret is your application's password. It's provided by DEXIS service support and shouldn't be stored in the end users machines (server or cloud storage). |
| Redirect URI | The redirect_uri is the url to which the user shall be redirected at the end of the authentication flow. |
| Authorization code | The code sent to your application as a query parameter og the Redirect URI. This code should be used to retrieve authentication access_token and refresh_token. |
| Access Token | The token you got at the end of authentication flow. This token sould be set in the Autorization header of all the requests sent to DEXIS Public Api. The access token is valid for one hour |
| Refresh Token | The refresh_token allows your app to get fresh user's access_token without asking the user to enter again his login/password. The Refresh Token is valid for sliding 14 days. |
How to get user access token
- Get authorization code Redirect the user to the authorization url passing your app's registration information:
- Get Access Token
- Refresh Token
https://envistab2c.b2clogin.com/envistab2c.onmicrosoft.com/B2C_1A_SIGNUP_SIGNIN/oauth2/v2.0/authorize?client_id=&response_type=code&redirect_uri=&response_mode=query&scope=offline_access%20https://envistab2c.onmicrosoft.com/ConnectPublicApi/User.Standard&prompt=login
After finishing the login flow, the user shall be redirected to your application redirect uri with the authorization_code in the query parapeters: https://your-redirect-uri?code=nmCNH9vHAxygZPLYYKOgybXRprm...
curl --location 'https://envistab2c.b2clogin.com/envistab2c.onmicrosoft.com/B2C_1A_SIGNUP_SIGNIN/oauth2/v2.0/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'client_id=<your_application_client_id>' \
--data-urlencode 'scope=offline_access https://envistab2c.onmicrosoft.com/ConnectPublicApi/User.Standard' \
--data-urlencode 'code=<user_authorization_code>' \
--data-urlencode 'redirect_uri=<your_application_redirect_uri>' \
--data-urlencode 'client_secret=<your_application_client_secret>'
Response example:
{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ink2OX.....",
"token_type": "Bearer",
"not_before": 1708442458,
"expires_in": 3600,
"expires_on": 1708446058,
"resource": "a591b17d-ad8e-4ba1-8c48-042e561268cf",
"profile_info": "eyJ2ZXIiOiIxLjAiLCJ0aWQiOiIxNjBhOTcxMS00Z....",
"scope": "https://envistab2c.onmicrosoft.com/ConnectPublicApi/User.Standard offline_access",
"refresh_token": "eyJraWQiOiIxQzd5OG1yVUI4Y.....",
"refresh_token_expires_in": 1209600
}
curl --location 'https://envistab2c.b2clogin.com/envistab2c.onmicrosoft.com/B2C_1A_SIGNUP_SIGNIN/oauth2/v2.0/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: x-ms-cpim-geo=NA' \
--data-urlencode 'grant_type=refresh_token' \
--data-urlencode 'client_id=<your_application_client_id>' \
--data-urlencode 'scope=offline_access https://envistab2c.onmicrosoft.com/ConnectPublicApi/User.Standard' \
--data-urlencode 'refresh_token=<user_refresh_token>' \
--data-urlencode 'redirect_uri=<your_application_redirect_uri>' \
--data-urlencode 'client_secret=<your_applicaiton_client_secret>'
Response example:
{
"access_token": "eyJhbGciOiJSUzI1NiIsImtp....",
"token_type": "Bearer",
"not_before": 1708443099,
"expires_in": 3600,
"expires_on": 1708446699,
"resource": "a591b17d-ad8e-4ba1-8c48-042e561268cf",
"profile_info": "eyJ2ZXIiOiIxLjAiLCJ0aWQiO....",
"scope": "https://envistab2c.onmicrosoft.com/ConnectPublicApi/User.Standard offline_access",
"refresh_token": "eyJraWQiOiIxQzd5OG1yVUI4YzBBZGl2....",
"refresh_token_expires_in": 1209600
}