2
votes

Problem: I'm trying to use Postman to get an valid Azure AD access token that I can then use to pass on a request to an Azure Function protected by Azure Active Directory (Easy Auth).

I've read / viewed numerous explanations on how to do this. CGillum's entire blog for example. Some of the best ones (that don't quite work for me) are:

I've verified that my ClientID, secret, and callback are all correct. I've ensured I have (what I think are) the correct permissions to the app I registered in my directory. I've got back a valid Bearer tokens in both of the first two examples above. No matter what though, when I pass this token back in the Authorization header I get a message that states "You do not have permission to view this directory or page."

My hope at this point is that someone reading this will point out the obvious thing that I missed.

Thanks in advance

1
What is the resource URI you use when you get the access token? For example, if I wanted a token to access Azure AD Graph API, I would use the https://graph.windows.net resource URI. This should match what is configured for the app in AAD.juunas
Great question! I was using https://<myfunctionapp>.azurewebsites.netThatCreole
That is probably wrong. You can find the app by finding the Azure Active Directory blade in Azure portal -> App Registrationsjuunas
Hmm is the resource URI you're talking about the same as the "App ID URI"? Because that's a madeup bogus thing that it automatically generated when I registered the app.ThatCreole
Yes that one! It's an identifier for the app :)juunas

1 Answers

4
votes

We could use the following way to get the easy auth token easily.

1.Vist the following url from browser and input your creditial.

https://{yourfunctionAppName}.azurewebsites.net/.auth/login/aad

enter image description here

2.After that we could get the easy auth token after decode the url.

enter image description here

3.Test it with Postman

enter image description here