It works after adding V2.0 in /oauth2/v2.0/token
Microsoft Graph API error: Access token validation failure. Invalid audience.
We have registered the app in AAD and granted the following permission to Microsoft Graph under API permissions in Azure portal
After passed in tenant id, client id, client secret.
we generated an access token
When I call the users API endpoint, I got an Invalid audience error as below:
Can anyone please point me where the issue is. thank you. I am not sure about resource: "00000002-0000-0000-c000-000000000000"
2 answers
Sort by: Most helpful
-
-
Vasil Michev 108.1K Reputation points MVP
2022-09-04T14:02:33.483+00:00 First of all, you are using the client credentials flow - this requires Application permissions, not Delegate ones. To understand the difference between the two types and decide which one is more appropriate for your scenario, read here: https://learn.microsoft.com/en-us/graph/auth/auth-concepts#delegated-and-application-permissions
Moreover, the method you seem to be using corresponds to the old Azure AD Graph API, not the Microsoft Graph one (audience/resource should be "00000003-0000-0000-c000-000000000000").