[Bug] Blazor server does not handle the MsalUiRequiredException
See original GitHub issueWhen calling Blazor server for the acquire token silent (or OBO) part, or when there is a need for more scopes or conditional access, Blazor does not handle context.Result = new ChallengeResult(properties);
in AuthorizeForScopesAttribute, like in MVC or Razor.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Handling MSAL Exceptions in Blazor Server App
1 Answer 1 ... Received same error: MsalUiRequiredException: No account or login hint was passed to the AcquireTokenSilent call. Microsoft.
Read more >Suggestions on Debugging Blazor Server AAD/B2C example
... MsalUiRequiredException was thrown due to a challenge for the user. ... This error usually indicates that whichever Root CA is within the...
Read more >Handle errors and exceptions in MSAL.NET
MsalServiceException is thrown when the Identity Provider (Azure AD) returns an error. It's a translation of the server error.
Read more >Blazor - Sergey Tihon's Blog
MsalUiRequiredException: No account or login hint was passed to the AcquireTokenSilent call. ... The reason is not obvious from the error message.
Read more >Blazor Server App suddenly throws error in blazor.server.js
I have no idea how to deal with this as it is the Blazor code itself. The line it ends on shows here...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jennyf19
Case where a cookie exists, but the token does not exist in cache and an attempt to acquire a new token (running locally).
in _Host.cshtml:
method in _HostAuthPageModel.cs:
So, at initial page load of the application the
OnGet()
method is executed, the user is authenticated (due to the cookie), then attempting to acquire an access token throws anMicrosoftIdentityWebChallengeUserException
exception (as expected). When theconsentHandler.HandleException(ex)
executes, the following exception occurs:@jennyf19 Thank you for the help. I emailed you!