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
Sometimes logins fail with login in progress #1069
Comments
Manually clearing session seems to work; still need to do more testing...
|
@JordanMarr Is this happening only with |
My authentication code (as a React hook) is below (my tenant id and authority replaced with placeholders).
|
I ran into this today and found an easy way to repro.
The only way to successfully login after encountering this is as @JordanMarr said, delete sessionStorage and any cookies. |
@AndrewCraswell Thanks for the steps. We are working on something similar to this (but for other error types) using #1024; the initial implementation has some flaws and I am working on fixing this. The PR is primarily to clean up intermittent cache which is created during login/token calls when the flow bails out in an error case. What you brought up is an interesting edge case, |
Did you mean #1042? I had seen that PR earlier but for some reason thought it had already been merged. |
Sorry yes. It is #1042. It isn't merged as I think our approach causes issues in some error cases. I will do a new version soon. But as I stated, the use case you mentioned is a corner case and with concurrent requests, we need to identify a stale request vs on going one which is tricky as we do not remember application state. Will reach out once I have a solution in place. |
I was able to find another way to repro this issue in a bit more egregious way. These steps will break when using Redirect login method:
This example was done with See also: |
Yes. The above example makes sense. Would you be able to test if I send a private build? |
@sameerag Absolutely, would be happy to. |
@sameerag Was this one of the items addressed in Beta 4? I'm assuming not since I can still repro it. Weird question though, because we've hit this issue again in a new scenario with a corporate customer. On Edge browsers when the user initiates a login, the redirect to |
@AndrewCraswell beta-5 isn't released yet. We plan to do it tomorrow and release 1.2.0 around Dec 6-8th. |
#1042 is now merged to dev. |
@sameerag is this issue fixed in beta? |
I'm still having this issue in 1.2.0 with the redirect. I entered this state from a bad login and now it just loops. I'm using local storage. There are no cookies set when I encounter this and even if I clear local storage and make sure there are no cookies, I'm still stuck in the endless loop. Also, where is it documented that the redirect will return to the initiating page but with a #id_token stuck on my url?` Per the comments above, I guess that once a cookie indicating login in progress gets set on the https://login.microsoftonline.com origin, it is never removed even if you signout and is passed to the login request from my app. Cleaning the login.microsoftonline.com cookie and origin storage for my app does fix the loop. |
@aappddeevv The loop is probably triggered from AAD where if a given request after failing is retried multiple times. Since this issue is partially addressing the cache clean-up issues, it gets confusing to track a new use case with the same ticket. Can you please:
Same applies for anyone following this thread. Please raise a new github issue helping us track different use cases clearly. Closing this ticket. |
I have the same issue with B2C sometimes the app open a new login tab and AuthenticationState.InProgress keep in true. Sometimes the new tab is closed automatically after 3 or more minutes. @sameerag Should I open a new ticket? |
Got the exact same problem as @betterliyu. Why is it even closed? |
Same problem as @betterliyu and @crobin1 |
I've noticed if you are already logged-in with your Azure AD account somewhere and then browse the web app secured by msal.js in the same browser session or another tab, it's stuck in "In Progress". But if you open another window of the same browser and try again, it works. Closing completely the browser and reopening it work as well. |
@sameerag Could you reconsider this issue and reopen it? |
@crobin1 Please open a new ticket and our livesite engineer would be happy to help you solve this. Thanks! |
I'm submitting a...
Browser:
Library version
Current behavior
Sometimes I can login successfully, but other times it fails and it shows a login is "InProgress" in my Session Storage. Clearing cookies or clearing session storage won't fix it, but clearing both will. Opening in "Incognito" mode or "InPrivate" mode will also fix it.
Should I be detecting this weird state and trying to programmatically clear the session storage and cookies?
Expected behavior
It should either log in correctly every time, or it should automatically clear the session state and cookies, or whatever it needs to clear.
Minimal reproduction of the problem with instructions
I still don't understand what is causing my logins to sometimes fail with the "InProgress" status so it's hard to give steps to reproduce.
The text was updated successfully, but these errors were encountered: