Aad graph error. when using Microsoft Graph to manage users.
Aad graph error To correct this error, there are two places to check. read%20mail. microsoft. GraphClient nuget to create and manage users in our Azure AD test tenant. Like the Reply URLs listed above this issue is correct on the Authentication page of the App Registration. I've delete and re-added the APIs. When I call the users API endpoint, I got an Invalid audience error as below: After researching this error the most common solution was to set the permissions for the API. Below is the code in my AzureAuthenticationProvider class which inherits from IAuthenticationProvider: After January 31, 2025, all applications – both new and existing – will receive an error when making requests to Azure AD Graph APIs, unless they’re configured to allow extended Azure AD Graph access. Learn about errors that can be returned in Microsoft Graph responses. when using Microsoft Graph to manage users. After passed in tenant id, client id, client secret. Learn about errors that can be returned in Microsoft Graph responses. Errors are returned using standard HTTP status codes and a JSON error response object. In summary the call requires both of the following: 2) The MS Graph access needs to have the proper permissions. ActiveDirectory. A common mistake that causes in this error is trying to use a token acquired for Azure AD Graph APIs, Outlook APIs, or SharePoint/OneDrive APIs to call Microsoft Graph (or vice versa). We have registered the app in AAD and granted the following permission to Microsoft Graph under API permissions in Azure portal . Resource = "https://graph. Azure. First, check to see if the application is configured to allow Public Client flows. scope=offline_access%20user. but still we are not able to login when trying to login with application and it is throwing the below exception . com"; An access token has an audience (aud claim) that specifies what API it is meant for. . readwrite. we generated an access token . This had already been done and has permissions to read basic/full profiles. Your client app needs to use your API's client id or application ID URI as the resource. The error happens most likely because the user does not have sufficient permissions. We understand that some apps may not have fully completed migration to Microsoft Graph. Following this sample application we can create and update users in Azure AD via Graph API. We are using Microsoft. Looks like your client app is acquiring a Microsoft Graph API token: options. Ensure that the resource (or scope) your app is acquiring a token for matches the API that the app is calling. We are trying to implement a Graph API in our project and we have provided user consent to the following scopes.