I’m trying to fetch a token using the endpoint shown in the image. When I use the scope https://graph.microsoft.com/.default, I get an error. However, if I use the scope openid offline_access 7cb56db3, I can get the token successfully.
The problem is that when I use this token to call the Microsoft Graph API to create a user, I get the error: "Access token validation failure. Invalid audience."
I’ve already added the required permissions, like Directory.ReadWrite.All and User.ReadWrite.All, under Microsoft Graph in the app. But despite this, I’m still having issues when trying to get a token with the Graph scope.
Could you please help me figure out what I might be missing?
2
Answers
i think the scope value is wrong in your postman. if the purpose is only to request a token for adding user, you need to pass in scope value as scope: User.ReadWrite.All. if you need multiple scope, you can pass them like this scope: Group.ReadWrite.All GroupMember.ReadWrite.All User.Read User.ReadWrite.All
You probably want to mask the actual secret in the post man screenshot.
Please double check the configurations on B2C following the steps and try again.
Check Application Registration in Azure Portal
1. Navigate to Azure AD App Registration:
2. Verify API Permissions:
3. Expose API (If Needed):