-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Several users are unable to log in due to the error "Unable to get user session following successful sign-in." #13940
Comments
@k1350, thanks for opening this issue and sorry to hearing your users are experiencing this.
|
@cwomack Thank you for your reply.
The logs and network requests have not been captured.
OS: Windows 10
If we set the domain of our application as
I have been informed that cookies are enabled. This is additional information regarding the issue. In our application, we added a process that signout and redirects them to the top page when a So I guess it comes down to this. Sign-in is failing with the error: However, on the other hand, a The
We know that |
@cwomack Additional information: A user who encountered the problem reported that sign-in worked properly in Chrome's Incognito Mode. However, the issue still persists when not using Incognito Mode. |
@k1350, appreciate the follow up. After reviewing this further, I think we'll need more information from the users that are experiencing or more logs if you can produce them whenever this happens with your app. When using SSR, "sharing cookies with another application running under the domain sub.example.com" will not work out of the box. However, the fact that this is no issue for your Firefox and Chrome Incognito users may be a sign that the users experiencing this have some type of extension or something running on the client that's impacting the CookieStorage you've implemented. Are you able to follow up with these users further and get any network requests or console logs in their browser? We'll try to reproduce this in our side, but still not quite sure how. |
Edit: This (below text and my issue) all seems to be related to localhost, so probably not really relatecd to this issue and my apologies for the noise I can open a separate issue if necessary but I am seeing the
EVERY time if I use safari when running locally. Chrome and FF both work fine but I am unable to log in to my application with safari and get this error. This is my setup:
Disabling Probably these: |
Hi @xconverge Safari restrictedly requires https protocol in order to set cookie attribute |
@cwomack Due to the user experiencing issues with the application in Chrome, he has decided to stop using it, which has made it difficult to obtain network requests or logs. The user mentioned that he was unable to log in even after disabling all extensions. The user appeared to have an antivirus-related toolbar installed, so I installed the antivirus software he likely uses, but I still couldn’t reproduce the issue. This seems to be a unique situation that's difficult to replicate outside of the user’s specific environment. I will reach out if I obtain any additional information, though it’s unlikely that we’ll find much more. |
@k1350, sorry we couldn't help reproduce this or figure out the root cause. But if you have another user that experiences this and can find a way to get some logging around it or reproduce reliably, feel free to comment back and we can reopen the issue. |
@cwomack Another user has encountered an issue that seem likely to be related to this one. Although we still haven’t been able to reproduce it, we’ve gathered more detailed information since our previous report, so we’d like to share it. Application ConfigurationIn the previous comment, I mentioned:
However, we have since removed this process. Additionally, I forgot to mention last time that we have another relevant implementation. Specifically, we have a mechanism to sign out and reload the page if a "tokenRefresh_failure" event occurs in Auth events. IssueAlthough the application appears to have signed out, a POST request to This situation then leads to the screen reloading repeatedly on its own. After manually deleting all cookies saved in Chrome over all time periods, the application returned to a normal signed-out state. HypothesisIt seems that, for some reason, cookies may not be deleting properly. The previous user mentioned that "deleting cookies manually did not resolve the issue." Additionally, it seems that even after repeatedly attempting the sign-out process, The following errors might be occurred alongside the 400 error from
Moreover, In our application, if Thank you. |
@cwomack Hello. We were able to obtain the logs. Would it be possible for you to kindly reopen this issue? Logs
|
For those encountering a similar issue, here is the root cause that we identified: The issue stems from using In our case, we explicitly specified the 'use client';
import { Amplify } from 'aws-amplify';
import { cognitoUserPoolsTokenProvider } from 'aws-amplify/auth/cognito';
import { CookieStorage } from 'aws-amplify/utils';
import { amplifyConfig } from '..';
Amplify.configure(amplifyConfig, { ssr: true });
cognitoUserPoolsTokenProvider.setKeyValueStorage(
new CookieStorage({
domain: "example.com",
secure: true,
path: '/',
sameSite: 'lax',
expires: 30,
}),
);
export function ConfigureAmplifyClientSide() {
return null;
} However, when When the user logs out on the client side, cookies with a different This was the reason for the login failure. |
Before opening, please confirm:
JavaScript Framework
Next.js
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
CDK
Environment information
Describe the bug
Most users are able to log in without any issues, but some users have reported that they are encountering the following error when attempting to log in:
UnexpectedSignInInterruptionException: Unable to get user session following successful sign-in.
After interviewing an affected user, we found that he can log in using Firefox, but he is unable to log in with Google Chrome, no matter how many times he trys.
Clearing caches and cookies did not resolve the issue.
We have investigated this thoroughly but have been unable to reproduce the error, and the cause remains unclear.
We also reviewed previously raised issues but did not find any information that could help resolve the problem.
What kind of situations can trigger this error?
We would like to know how to resolve it for users who are encountering this error consistently.
Thank you.
Expected behavior
The authentication process should successfully complete without any errors.
Reproduction steps
As the issue has not been reproducible, we're unable to provide specific steps that consistently trigger the error. Below are the general steps a user would follow.
Code Snippet
// Put your code below this line.
Log output
aws-exports.js
No response
Manual configuration
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: