Azure AD Silent Token Acquisition exceptions

Alex Agranov (Collabera) 1 Reputation point
2020-07-06T21:39:58.457+00:00

This code in our ASP.NET Core application:

            result = await application.AcquireTokenSilent(scopes.Except(Scopes), account)
                                      .WithAuthority(authority)
                                      .ExecuteAsync();

sometimes fails with these 2 exceptions:

Microsoft.Identity.Client.MsalUiRequiredException
System.ArgumentNullException

The ArgumentNullException might be happening because the Azure AD ObjectID is null, and I have no idea why the other exception would be happening if the user had already performed 2FA before.

Could someone point me in a direction?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,089 questions
{count} votes