How to retrieve logged in user's authorization code for getting the auth token for an extranal REST API integrated with AAD

vamseeinala
Kilo Contributor

Hello,

I have a scenario where I need to access a Azure Active Directory authorization enabled Azure Web Api endpoint for Script Include code. I want to use the logged in user's auth code to retrieve the auth token for the AAD resource. Any pointers on how to achieve this?

I have tried configuring a REST API endpoint, but that doesn't have to the option to provide the "AudienceUri" / "ResourceID" of the resource for which I want to acquire the authorization token.

Thanks
Vamsee

5 REPLIES 5

Although, post is very old I still thought this would help.

Ideally in this case you should use service principal authentication.

Create an App in your AAD for this specific purpose, use it's clientId and secret to generate Auth token and use that to call your API.