-
Notifications
You must be signed in to change notification settings - Fork 119
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
Can we stay "SignedIn" when we start the app ? SignedInException a User is already Signed In #2897
Comments
Hi @Moisenberg, thanks for details.
This would be up to your use cases, whether you would like to require your end-users to sign in again after closing the app. You should be able to let your end-users stay signed in and let Amplify manage the auth session, so you do not need to sign the user out. In regards to the issue you described where after signed in for a few weeks, the app shows a sign in screen. Can you clarify
If both are true, it sounds like a bug. The behavior I would expect is if the refresh token cannot be used anymore, then the user should be moved to a signed out state, Authenticator would show the sign in view, and sign in should be successfully.
Authenticator should be using Amplify to manage which views to display based on the state. This ultimately sounds like something we need to reproduce once we have some more clarification on the details and steps. If you can provide us with a more verbose version of MainActivity.kt, we can look into this further |
Thank you for your quick reply. My code (related to Authentication is really the default Authenticator UI Component)
I added the following code just before
Because, as I said earlier, I got "notsignedin" in the log even if i have a SignedInException A user is already signed In. In fact, I saw that someone had a similar problem, but from reading the post I didn't see a final solution. Thanks for your time and have a nice day, As a reminder, here are the version of the depedencies i use for now, which aren't the latest, i would like to update them later but I'm scared to break everything since for now my app is globally working.
|
Thanks for the information. Our team will look into reproducing it in a locally and get back to you . |
Hi @Moisenberg I believe I fixed the issue you are reporting a while back (#2830). There were cases we were reporting that the user was signed out, when in fact, the user was still signed in, but did not have valid credentials. This issue has been fixed to report the proper state (signed in, but an exception will be returned when fetchAuthSession fails). Please update to Authenticator version 1.2.3. There are a significant number of bug fixes between 1.0.0 and 1.2.3. aws-auth-cognito should also be updated to 2.22.1. Let me know if you are still seeing issues after upgrading. |
Indeed it seems correct Thanks for the quick answer ! |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Good morning,
I observed the following behavior (Emulator):
I can authenticate and when i restart the app, since i didn't sign Out, I was still SignedIn, it was probably normal but I thought it was an interesting feature since it's not required to type our login/password again and i haven't tried yet to authenticate with a federated party.
However after a few weeks, i realized that i was on the SignIn Screen again, and when I tried to Sign In, I received a SignedInException : A user is already SignedIn with a "something went wrong" temporary message on the bottom.
From what I read on internet, even if i haven't found that information yet it seems that the reason is that my credentials are outdated since the refresh token has expired which means that i'm still signedIn but with wrong credentials.
However, i didn't find a way to force the signOut when the refresh token has expired.
I'm using
I used the authenticator UI to authenticate my users.
Here are some parts of the code
Interestingly, The
AuthFetchSession()
brings the message "notsignedin" in the logs when I got the SignedInException a User is already Signed in.I thought that the signOut was managed by authenticator UI when this situation happens.
The idea with
AuthFetchSession()
was to force the signOut in such a situation but it will also be called when no one is signed In. Moreover i don't see an easy way to get the AuthState in the code of the authenticator to call the signOut function.Then I have the following questions :
PS: sorry for the code without colors but i don't understand how to get a beautiful code.
Thank you & have a nice day.
The text was updated successfully, but these errors were encountered: