-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
First login fails, second login redirects to ".com/null" #1039
Comments
@AndrewCraswell Can you share the steps taken (or conditions that exist) to consistently reproduce the issue? I have heard about this, but I've personally had trouble reproducing it. Thanks! |
@AndrewCraswell As a workaround, can you try setting |
We might be able to. At the moment it's necessary as we have different login flows. A user who is registering needs to be redirected back to the registration page to complete their profile while returning users should be redirected to the page that login was initiated from.
Unfortunately not, I've been unable to repro on my own machine and I've tried various scenarios. But I have seen it happen on a few user's systems. I'm hoping that verbose logging on the user's machine will give more detailed info to help isolate this... |
@AndrewCraswell Gotya. I would suggest exploring that in the immediate short-term, until we are able to find the cause (I have a theory, but it may be a little bit until we're able to confirm, fix, and release). |
We are exactly facing the same issue, started happening recently. |
@PraveenVerma17 are you able to get a consistent repro? Definitely interested in seeing some verbose logs and/or network trace HARs that show the issue happening... If I could just get this repro'ing on my own system I would be debugging it, but I've been reliant on users reporting the issue occasionally. |
Not consistently, it happens intermittently. My guess its because of we should just hard code the value true should solve the problem. |
I've already tried that as well. We still had users reporting issues even after a month. |
I am going to add hack in my application router code |
I was able to get a network trace HAR and full verbose console output. I've uploaded both and it's accessible to Microsoft FTEs: Examining the console logs I see a few errors when the user first hits our site. There is an attempt to renew the token, and after about 1 second the user encounters:
Our code is not handling a timeout issue, so it spits out a long stack trace to the console which can be ignored. At this point the app knows the user is not authenticated, so they're redirected to login. User chooses their account, and are successfully redirected back to the app. At this point, the following is logged:
App thinks user is still not authenticated, so again they get redirected to the login page. This time it's successful and the state matches so the app knows the user is authenticated. |
Seems like the double login issue is related to the IdToken renewal failing, which is something we had been considering. Any ideas for manually expiring the IdToken so can try to debug this scenario with consistent behavior? I know we can apply an offset for access tokens, but I'm not aware of anything similar for IdTokens... |
@AndrewCraswell Thank you for that information, that is very helpful, as we're aware of timeout issues from STS relating to retrieving/renewing tokens. And I'll find out about manually expiring idTokens and get back to you. |
Thanks @jasonnutter I'm interested to understand better about the STS timeout issue... Is there a better way we should be handling this to prevent the double login? Or do you think these are separate issues that might be getting conflated? Trying to figure out if there's a hack or workaround that can be done on our side since we're getting more escalations. |
For those with this issue, please try @AndrewCraswell We're working now to better understand the root cause of the timeouts (there's another MSFT team that is also experiencing them at an unacceptable rate). I do think they are related, based on what I've seen so far. |
@AndrewCraswell do you know, whether users that are facing the issue with double navigation + /null navigation are using Edge's InPrivate mode? Because I see the exact same behavior in this mode in Edge. I've debugged the issue a bit and it looks to me that Edge in InPrivate mode clears up the As result when you are navigated back to the application the For me changing the storage type to cache: {
cacheLocation: 'localStorage',
storeAuthStateInCookie: true
}, |
This is useful info! Unfortunately we have seen that the users reporting the issue are not using InPrivate, and we've started using a cookie for all users so as to make troubleshooting easier. I do think that people who encounter such issues should check that (a) their cache is not being cleared, and (b) if there are any token renewal timeouts. Both could cause the issue Being described. Might be more useful to rename this issue since the error logs point to token renewal timeouts being one of the root causes. |
@anton-gorbikov Unfortunately, that is known behavior with Edge InPrivate: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/13861050/ The workarounds you mention, as well as putting your authority and web application domains in the same security zone, are our recommended mitigation at this time. |
@jasonnutter is this resolved |
@AndrewCraswell can you confirm the things we talked about last week have resolved this issue for you? |
@DarylThayil Can confirm that the redirect to Btw we took some action items from our discussion last week regarding Id Token renewal timeouts. Just pushed some changes using Access Token against our APIs with custom scope. I will be monitoring our App Insights to see if timeout errors continue, but so far results are positive. Thanks again for the help! |
thanks @AndrewCraswell |
I'm submitting a...
Browser:
Library version
Current behavior
Over the last month, users on Edge have been reporting that they get a sort of "double login issue". When presented with the login screen, they choose the account to authenticate with and are redirected back to the app. At this point, they're redirected back to the login page a second time, they choose their account, and are returned to the site correctly on return. However, getting a consistent repro has been problematic.
Today we finally have a user on Edge (one of our offsite vendors) who can consistently repro the issue. Unfortunately, no errors show in the console, and the user was unable to export the network trace HAR as the option was greyed out in Edge browser. They did however take screenshots:
https://i.imgur.com/TjIShD5.png
On the second redirect back to the site, it seems the user is being sent to
techskillsforbusiness.com/null
rather than the correctredirectUri
The application uses the following configuration for MSAL:
The redirect to
/null
is a high priority breaking issue for us which is blocking the launch. As an initial step, I've enabled a logger to get a verbose trace of everything that occurs and will update the bug when the user is able to test again.With the limited information here, any idea if this is a known issue? Any troubleshooting advice would also be greatly appreciated.
Seems like this could be related to the following issues:
#347 (redirect to /null)
#981 (double login)
#1035 (double login)
Expected behavior
User should be successfully logged in on the first attempt and redirected to the correct
redirectUri
.The text was updated successfully, but these errors were encountered: