question

RadhaRajendran-2501 avatar image
0 Votes"
RadhaRajendran-2501 asked JamesTran-MSFT commented

how to generate token : Azure Active Directory and Expose 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 the application, exposed the API and added the scope. I have couple of question to access this api.

  1. How to i call the end point of that application/ how or from where I get the access token?

  2. If i register the client application, how do I generate token and call/consume the web API exposed above?

Your insight s much appreciated.

Thanks,
Radha



azure-active-directory
· 1
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.

@RadhaRajendran-2501
Thank you for your post and I apologize for the delayed response! Because its been a while since your original post, I just wanted to check in and see if you were able to resolve this issue?

When it comes to getting an access token using the example you linked, you should be able to do so by calling the oauth2/v2.0/token endpoint.

 POST https://login.microsoftonline.com/{
                    {TenantID}}/oauth2/v2.0/token
 Or
 POST https://login.microsoftonline.com/common/oauth2/v2.0/token

For more info:
Request an authorization code
Getting started with - Azure REST APIs with Postman (2021)


If you have any other questions, please let me know.
Thank you for your time and patience throughout this issue.

0 Votes 0 ·

0 Answers