Token validation failed

Radha Rajendran 61 Reputation points
2021-03-30T14:51:13.483+00:00

Hi Team

I am trying below example.

https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-resource-server

I have registered one web API and client API. In client API i have added the scope of web API.

Now i generated the token using user name and password for client api and when i tried to pass the generated token to web api and i am getting 401 unAuthorized.

Any leads would be appreciate.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,473 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marilee Turscak-MSFT 33,801 Reputation points Microsoft Employee
    2021-03-30T20:07:04.867+00:00

    Hi @Radha Rajendran ,

    There are a number of things that can cause this error. Please make sure you have entered the correct TenantID, ApplicationID and Application_Secret, and the Group name in the application.properties file under src/main/resources

    I would also check some of the solutions in these related threads:

    Access Token Response Unauthorized
    Unable to Authenticate Using Spring Boot Sample
    Invalid Token Response
    Token is not Authorized immediately

    If you still have this issue, please provide any trace logs you may have, along with a screenshot of the API permissions that you have added.