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)
{
}
}