Description
After successful authentication,the access token endpoint allows you to access the SureReturns endpoints. The endpoint supports OAuth 2.0 protocol
API Endpoint
Endpoint: https://<tenant_name>.b2clogin.com/<tenant_name>.onmicrosoft.com/b2c_1_signin/oauth2/v2.0/token
Method: GET
Request
"Content-Type: application/x-www-form-urlencoded"
"client_id=<your_client_id>"
"client_secret=<your_client_secret>"
"scope= https://<tenant_name>.onmicrosoft.com/appId/.default"
"grant_type=client_credentials"
Response
Success Response - 200 OK The endpoint will provide a access token value.
Sample Response:
{
"token_type": "Bearer",
"expires_in": 3599,
"ext_expires_in": 3599,
"access_token": "<access_token_value>"
}
Sample Response
{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IlVBN1VXN3l4cXJKTW9KZDFtc2NRd2tpQ0VhNzM3cXQzS0tYU3FaQkNtVzgiLCJ0eXAiOiJKV1QifQ.eyJ0ZnAiOiJCMkNfMV9zaWduaW4iLCJhenBhY3IiOiIxIiwic3ViIjoiZDg5MjlkMjMtODg3OS00NmEyLWFmM2QtYjcyYjJhNzRmMDE1IiwiYXVkIjoiY2FiN2Q0ZDYtMjUyMi00ZDFjLTkxNjctZjQ2NTM2OWFjMzY4Iiwib2lkIjoiZDg5MjlkMjMtODg3OS00NmEyLWFmM2QtYjcyYjJhNzRmMDE1IiwidGlkIjoiYmNjZmM3NDEtZTJjMi00NDY1LTkzMzgtYjhlNDQyYzFiNWE4IiwidmVyIjoiMi4wIiwiYXpwIjoiNTk4ODVEOTAtRkI2Ni00RDk0LUJFNEQtMzU0MkY4RTBEMDk0IiwiaWF0IjoxNzE2OTIyMDAwLCJleHAiOjE3MTY5MjU2MDAsImlzcyI6Imh0dHBzOi8vZXhhbXBsZS5jb20vdG9rZW4vaXNzdWVyIiwibmJmIjoxNzE2OTIyMDAwfQ.ABCDEF1234567890abcdefghijklmnopqrstuvwxyz",
"token_type": "Bearer",
"not_before": 1716922000,
"expires_in": 3600,
"expires_on": 1716925600,
"resource": "cab7d4d6-2522-4d1c-9167-f465369ac368"
}
Sample request [CURL]
curl --location 'https://example.b2clogin.com/example.onmicrosoft.com/B2C_1_signin/oauth2/v2.0/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'scope=https://example.onmicrosoft.com/abc12345-6789-def0-ghij-klmn78901234/.default' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=12345678-1234-1234-1234-1234567890AB' \
--data-urlencode 'client_secret=exampleSecret1234~abcdEFghIjklMnopQRst'