You should add https://graph.microsoft.com/ as the audience under the HTTP Request Action in Logic Apps.
See these examples:
Query Azure AD using Graph API and Logic Apps
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I am trying to get the list of all active directory users, but I am stuck.
I am using Logic App to trigger my Azure Function and my Azure Function has Managed Identity setup. So I am able to retrieve a token, but when I pass this token to:
GET https://graph.microsoft.com/v1.0/users
Authorization: Bearer {{token}}
then I'm getting the below error:
{
"error": {
"code": "InvalidAuthenticationToken",
"message": "Access token validation failure. Invalid audience.",
"innerError": {
"date": "2021-03-09T08:41:51",
"request-id": "e55aa5b0-c179-4e3c-ad0f-87b5c874cd58",
"client-request-id": "e55aa5b0-c179-4e3c-ad0f-87b5c874cd58"
}
}
}
How do I add the audience for the graph API?? Please help
You should add https://graph.microsoft.com/ as the audience under the HTTP Request Action in Logic Apps.
See these examples:
Query Azure AD using Graph API and Logic Apps