-
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
Users being logged out with Invalid Refresh Token long before expiry. #2490
Comments
Hello, as a follow up to the above I have tried adding
I have verified that our amplifyconfiguration.json file is identical to our iOS application, which is not experiencing these issues. |
There's nothing wiping the user from our side, we only use the sign out method in the library if the user manually logs out, but we don't see this event often via our analytics. |
Hi @GraemeRG I was able to reproduce your scenario only when I do a Some troubleshooting questions for you:
|
Hello, One thing I have noticed that I was hoping you could assist with. I have noticed in the loggers output that the signInMethod is recorded as
However the authType still reads USER_SRP_AUTH. I am unsure if these are connected and if this is necessary? |
That is quite strange, can you paste the relevant logs that you are seeing as I am not seeing the same on my end. I have CUSTOM_AUTH in my configuration but I am hardcoding it to USER_PASSWORD_AUTH in the authentication flow inside sign in options similar to what you have above. |
I have split the logs into the three different parts of the journey, from before a user authenticates, once a user signs in and then after the user comes back to the app with an invalid token. These files are availble here: |
Hello there, I have created a demo project that mimics the necessary parts of our set up to replicate this issues. You can get access to this here. |
I also have the same issue. I have configured my token validity durations as below: If access token is expired(after 16 min) I call
Here is my implementation code:
` |
|
Before opening, please confirm:
Language and Async Model
Kotlin - Coroutines
Amplify Categories
Authentication
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
We have noticed a large spike in user's being logged out of our application following our upgrade to the Amplify 2.x series of libraries. After some investigation we have found that upon calling Amplify.Auth.fetchAuthSession() the user will receive the following result:
AWSCognitoAuthSession(isSignedIn=false, identityIdResult=AuthSessionResult{value=null, error=SessionExpiredException{message=Your session has expired., cause=NotAuthorizedException(message=Invalid Refresh Token.), recoverySuggestion=Please sign in and reattempt the operation.}, type=FAILURE}, awsCredentialsResult=AuthSessionResult{value=null, error=SessionExpiredException{message=Your session has expired., cause=NotAuthorizedException(message=Invalid Refresh Token.), recoverySuggestion=Please sign in and reattempt the operation.}, type=FAILURE}, userSubResult=AuthSessionResult{value=null, error=SessionExpiredException{message=Your session has expired., cause=NotAuthorizedException(message=Invalid Refresh Token.), recoverySuggestion=Please sign in and reattempt the operation.}, type=FAILURE}, userPoolTokensResult=AuthSessionResult{value=null, error=SessionExpiredException{message=Your session has expired., cause=NotAuthorizedException(message=Invalid Refresh Token.), recoverySuggestion=Please sign in and reattempt the operation.}, type=FAILURE})
This is occurring as little as 30 minutes after the user is authenticating. We have our auth token expiry set to 120 minutes and our refresh token expiration set to 90 days.
Reproduction steps (if applicable)
Code Snippet
Log output
amplifyconfiguration.json
GraphQL Schema
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: