-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Blazor WASM application hangs on MSAL Authentication. #39104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you for filing this issue. In order for us to investigate, please provide a minimal public GitHub project that reproduces this issue. |
Hi @adam-becker. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
@TanayParikh I will try, might not be able to get to it until next week. |
Hi @adam-becker. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate. See our Issue Management Policies for more information. |
I can reproduce the problem with this command:
First login works. Opening devtools appears to reliably work around the problem. |
Thanks @eamonn-coleman! Looks like the same issue I'm seeing. |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
With Edge, if the browser is launched in InPrivate mode, hangs do not occur during authentication. Otherwise yes. .NET 6 |
I'm facing the same issue here. Any workaround or solution on this yet? |
Same problem here :( |
I could get around myself setting the login mode as 'Redirect'.
|
Same problem here, with the Blazor project being created from default VS2022 (V17.2.3) templates and no additional changes. Seems to be related to the Popup-Window and "MsalProviderOptions" being on default "LoginMode=popup". The problem occurs only in Chrome (for me) and not in Edge. |
I have the same problem for months now w/ VS2022 v17.2.3 and "LoginMode=popup". A temp workaround I use is to have the Chrome DevTools open prior to login. Not recommended, but another approach was to close and reopen Visual Studio. |
Does not seem to be a difference in browsers, I get it in both Edge and Chrome. |
Same here and the issue is getting worst by the day. Originally (a couple months back), this was happening a couple times a day. Now every debugging cycle takes 2-3 application restarts to eventually get through the login process. The login process gets stuck at /authentication/login-callback#state=... in the popup window. Like some others are suggesting, I tried opening the dev console prior to the login popup and it worked 10 times in a row. So this might be a workaround until the issue is fixed. After some more testing, even if it seemed to work for a while, the only viable workaround now is to used the redirect method. |
Thanks for contacting us. |
I get this problem too - large application, does a little bit of work on the login event. High CPU usage about 20% ongoing while deadlocked. |
using redirect mode & localStorage |
A bit of context for on our Authentication page: <RemoteAuthenticatorView Action="@Action" OnLogInSucceeded="@UpdateAuthenticationState" OnLogOutSucceeded="@ClearAuthenticationState">
<LoggingIn>
<LoadingSpinner/>
</LoggingIn>
<CompletingLoggingIn>
<LoadingSpinner/>
</CompletingLoggingIn>
</RemoteAuthenticatorView> public async void UpdateAuthenticationState()
{
var authState = await AuthenticationStateTask;
var user = Application.User.PortalUserAccessor.MapPortalUser(authState);
await FeatureFlagsClient.GetFeatureFlagsForUserAsync();
await BusinessContextService.LoadDefaultOrLocalStorageBusinessContext(user);
PortalUserAccessor.InvokePortalUserChanged();
} Here's some minimal snippets. From lots of poking around with this obscure bug I'm guessing it is when there is long running work on the OnLogInSucceeded callback |
I have the exact same issue in Google Chrome Mobile. My project is .NET 7. it seems to only happen when the #code.... part is added to the call-back. (tried to configure this in Azure Portal, with no luck) |
I have the exact same issue. Flow is stuck on "CompletingLogOut". This seems related to this. For me a fix was, to disable trimming for the app or just disable trimming for the auth assembly:
|
We think this was addressed as part of the fixes we did in .NET 7.0. Please update to that version and give it another try. |
Hi @adam-becker. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate. See our Issue Management Policies for more information. |
Is there an existing issue for this?
Describe the bug
Same as #38653. When using MSAL authentication in a Blazor WASM application, the login page hangs on the pop-up. Opening the browser's (specifically Chrome) developer tools causes the pop-up to stop hanging and proceed as normal. Our application was created from the Blazor WASM (PWA) template, no modifications have been done to any of the PWA related scripts.
Expected Behavior
The pop-up shouldn't hang at all, regardless of whether the developer tools are open or not.
Steps To Reproduce
To get the issue (it's intermittent as noted in here) we just click our sign-in button, the pop-up appears and just sits there. When this happens, opening the browser's developer tools does something and causes the pop-up to proceed and close.
I can provide more details directly to whoever needs to look at it.
Exceptions (if any)
No response
.NET Version
5.0
Anything else?
IDE: Visual Studio 2022 (2019 also seeing the same issue).
Output of
dotnet --info
:The text was updated successfully, but these errors were encountered: