1

I am developing a backend Web API for react SPA. The react SPA will do the authentication with the Azure AD, and send the auth token to Web API.

I need to know what are the API available from Azure AD which I can use to validate the auth token? I know there is graph APIs (https://aka.ms/ge) but do we have any Azure AD API to validate auth token.

Thanks in advance!

Saad Alam
  • 67
  • 1
  • 8

1 Answers1

0

You can make use of Postman API to generate the token and you can find expiration time in the response along with token like below:

enter image description here

To validate the auth token, you can make use of JSON Web Tokens - jwt.io.

  • After generating the auth token, you can paste the token in the above link and decode it.
  • Usually, the decoded token has sections like below:
    • header: It includes alg which specifies the type of algorithm used to digitally sign the token.
    • payload: It includes information about audience, scopes, expiration details, app details etc.
    • verification signature: It includes the digital signature of the token that was generated by Azure AD’s private key.

To check the token expiration, you can find expires_in variable under payload section of decoded token.

enter image description here

You can check the below references to know more in detail:

Validate Azure Active Directory (AD) generated OAuth tokens (voitanos.io)

How to verify token in Azure Active Directory – tsmatz (wordpress.com)

Sridevi
  • 10,599
  • 1
  • 4
  • 17