Microsoft Security | Microsoft Graph
An API that connects multiple Microsoft services, enabling data access and automation across platforms
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In the following code, the call to await graphClient.Me.Request().GetAsync(); never returns.
No exception is thrown. The App ID is registered with https://portal.azure.com/ for our tenant ID. The auth was originally some preview package, but I've since tried with Microsoft.Identity.Client and that doesn't work either.
protected async void GetMessages()
{
try
{
var scopes = new string[] {
"User.Read", "Mail.Read", "email", "Mail.ReadWrite", "Mail.Send", "profile", "User.Read"
};
// Build a client application.
IPublicClientApplication publicClientApplication = PublicClientApplicationBuilder
.Create(MyRegisteredAppIDGUID)
.WithTenantId(OurTenantIDGUID)
.Build();
// Create an authentication provider by passing in a client application and graph scopes.
DeviceCodeProvider authProvider = new DeviceCodeProvider(publicClientApplication, scopes);
// Create a new instance of GraphServiceClient with the authentication provider.
var graphClient = new GraphServiceClient(authProvider);
User me = await graphClient.Me.Request().GetAsync();
;
}
catch (Exception ex)
{
}
}
An API that connects multiple Microsoft services, enabling data access and automation across platforms
Did you resolve this issue. I am also facing the same issue.