question

RadhaRajendran-2501 avatar image
0 Votes"
RadhaRajendran-2501 asked azure-cxp-api edited

Token validation failed on Exposing API

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 and when i tried to pass the generated token i am getting 401 unAuthorized.

Any leads would be appreciate.

And i am unable to generate token with "Client_credentials" grant type. It gets failed saying scope needs to be added.

azure-active-directory
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @RadhaRajendran-2501 , this may be related to the last thread you posted. I posted an answer there. If that doesn't fix your problem please let me know and I'll figure this one out.

Best,
James

0 Votes 0 ·

The last thread is about generating the token using client_credentials.

However, the token generated using password gives me 401. I generated the token using client-app (client-id, client-screct, scope) and passed the token to access the web-app endpoint and i am getting 401.

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 referred above sample code. Let me know if anything is missing from my end in code or in configuration side.


0 Votes 0 ·

Any leads would help me @JamesHamil-MSFT

0 Votes 0 ·

0 Answers