question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question]: Recovering from a MsalThrottledUiRequiredException.

See original GitHub issue

I’m not sure if this is a bug or a change made to Microsoft.Identity.Client (M.I.C) between version 4.8.1 and 4.23.0.

But I used to be able to ‘reset’ a silent signin as below … {note: this isn’t exactly my coding but it should explains my problem)

GraphClient = new GraphServiceClient(new DelegateAuthenticationProvider(async (request) =>
{
	try //silent signin
	{
		var silent = await PCA.AcquireTokenSilent(Scopes, Accounts.First()).ExecuteAsync();
		//ABOVE FAILS WITH MsalUiRequiredException on both M.I.C version 4.8.1 and 4.23.0

		IsSilent = true; //flag silent is good
	}
	catch (MsalUiRequiredException ex)
	{
		if (IsSilent) //try silent reset
		{
			GraphClient = new GraphServiceClient(new DelegateAuthenticationProvider(async (request2) =>
			{
				var silent = await PCA.AcquireTokenSilent(Scopes, Accounts.First()).ExecuteAsync();
				//ABOVE USED TO BE OK WITH M.I.C version 4.8.1 AND I COULD CONTINUE BROWSING ONEDRIVE
				//BUT IT NOW FAILS WITH A MsalThrottledUiRequiredException using M.I.C version 4.23.0
			}));
		}
		else
		{
			//user interactive sign in here ...
		}
	}
}));

Using Microsoft.Graph Version 1.21.0 Using Microsoft.Identity.Client Version 4.8.1

These exceptions are thrown,

Exception thrown: ‘Microsoft.Identity.Client.MsalUiRequiredException’ in System.Private.CoreLib.dll Exception thrown: ‘Microsoft.Graph.ServiceException’ in System.Private.CoreLib.dll

However,

Using Microsoft.Graph Version 3.20.0 Using Microsoft.Identity.Client Version 4.23.0

These exceptions are thrown,

Exception thrown: ‘Microsoft.Identity.Client.MsalUiRequiredException’ in System.Private.CoreLib.dll Exception thrown: ‘Microsoft.Identity.Client.MsalThrottledUiRequiredException’ in System.Private.CoreLib.dll Exception thrown: ‘Microsoft.Graph.ServiceException’ in System.Private.CoreLib.dll

Has Microsoft.Identity.Client made a decisive change to completely disable looping clients and have no option for recovery other than an interactive signin, or is this a problem with an M.I.C upgrade ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:20 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
jmprieurcommented, Dec 1, 2020

Also I don’t understand how resetting the Graph DelegateAuthenticationProvider ever worked, given this is the same confidential client application.

0reactions
bgavrilMScommented, Dec 4, 2020

Going to close this for now, as I have tried ATS with those scopes and MSAL does give the token from its cache.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem to deploy to azure - Microsoft Q&A
It seems to be a problem with 2FA, but switching to the system web browser ... MsalThrottledUiRequiredException: AADSTS50076: Due to a ...
Read more >
[Bug] Authentication webview keeps opening on Android
I think this is not a problem, it simply means that the refresh token has expired and that interaction is required. It's acceptable...
Read more >
Microsoft.Identity.Client Namespace - Typedescriptor
AuthenticationContinuationHelper static Static class that consumes the response from the Authentication flow and continues token acquisition. This class should ...
Read more >
netFramework/Microsoft.Identity.Client.xml 2.0.5
MSAL's httpClient will no longer throw this exception after 4.19.0 ... request resulted in an HTTP 429 or 5xx, which indicates a problem...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found