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 Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marilee Turscak-MSFT 37,206 Reputation points Microsoft Employee Moderator
    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.


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.