I need to validate the auth token, from azure ad

Rafael Massinatore 21 Reputation points
2022-07-12T17:23:05.887+00:00

Hi, I am authenticating the user of my SPA application, I followed:
https://learn.microsoft.com/en-us/azure/active-directory/develop/single-page-app-quickstart?pivots=devlang-angular

I received the token, but I would like to verify in java, if this token is the right one, but I am not finding how I can do this, any help on how I can verify the backend with this token

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Cristian SPIRIDON 4,486 Reputation points Volunteer Moderator
    2022-07-12T20:18:58.73+00:00

    Hi,

    Below post explain how to validate JWT issued by Azure AD in java script:

    https://www.voitanos.io/blog/validating-azure-ad-generated-oauth-tokens/

    You have to pay attention to the aud claim and properly check the signature.

    Hope this helps!

    1 person found this answer helpful.
    0 comments No comments

  2. Alfredo Revilla - Upwork Top Talent | IAM SWE SWA 27,526 Reputation points Moderator
    2022-07-31T03:26:40.2+00:00

    Hello @Rafael Massinatore , for a generic approach take a look to Validate JWT tokens using JWKS in Java.

    Let us know if you need additional assistance. If the answer was helpful, please accept it and complete the quality survey so that others can find a solution.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.