-
Notifications
You must be signed in to change notification settings - Fork 549
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
No cached session while getting access token on version 2.69.0 #3433
Comments
Refresh tokens also have an expiration configured. What is the refresh token expiration set to in Cognito? Once a refresh token has expired, the user will need to sign in again. |
We have 730 days of expiration set for the project. So thats not the case. Also we're not experiencing similar issues on iOS where we have even more users. |
Can you provide your awsconfiguration file with sensitive information obfuscated? Additionally, what sign in type are you using? |
Hi @m-zagorski, that is helpful but looking for the awsconfiguration.json file in your app/src/res/raw folder. I was trying to also figure out what sign in method you were using. It sounds like if you are using password, facebook, and google, you are using the hosted (web) ui sign in flow and not SRP. If this is the case, please check the awsconfiguration.json file and see if openid is listed under the Scopes. If this is missing, the refresh token will not work. |
Hey, we have |
@m-zagorski I've got a few questions to continue asking.
Please try and provide the awsconfiguration.json file so that we can take a further look and make sure nothing looks misconfigured on that file. |
Hello, so:
As for the awsconfiguration.json file here it comes: (staging one has exactly the same structure):
|
@m-zagorski is it possible for you to provide detailed logs/stacktrace with sensitive information obfuscated? It would be helpful to understand under what condition no cached session messages are being logged to further identify root cause. |
@ankpshah Unfortunately we dont have full stacktrace - only the message from exception coming from cognito, I will check if we can change the logs so that we have full stacktrace |
@ankpshah Here is the stacktrace we're getting:
|
Hello @m-zagorski, The changes can be found here: 46fb3c3 Here is a quick summary: If the token fails to refresh, the caller will receive an exception with "No cached session". The caller is already aware of this. However, sometimes provided inner exception was null. This is no longer the case, you will receive additional details about exception. If you receive In any other exception case, the issue is likely to be transient. You may want to log this exception so you can report if you are seeing an abnormal amount of any other exception types. |
@m-zagorski @ankpshah please check my post: #3572 can you tell us if you get more information? On my side there I get few information why there no "No cached session". |
Describe the bug
We are using
aws-android-sdk-mobile-client
version 2.69.0 and are seeing a lot ofNo cached session
- almost 1k per day.So what is happening is that when we get
Unauthorized
we are callingAWSMobileClient.getTokens
with a callback - all calls to this method are synchronized and we're waiting for theAWSMobileClient
to be fully initialized (we think its initialized whenawsMobileClient.configuration
is not null).In return we're getting
No cached session
exception thrown from withinsignalTokensNotAvailable
method inside the client.Currently we are unable to update the library to amplify due to the changes that would be required on the backend side. however from analytics we can see that this issue is not only related to the current version - we're seeing it for quite few months.
Also important thing is that we have the
device tracking
turned off.To Reproduce
We were unable to reproduce it locally. What we see from logs, most cases are for the users that were not using the application for quite some time, so that the access token is expired, then when trying to refresh the tokens we get the
No cached session
. We have checked thatAWS Client
is initialized, also we have user data in the app - its only thatgetTokens
that makes the session invalid.Which AWS service(s) are affected?
Only android -
aws-android-sdk-mobile-client
Expected behavior
getTokens
return correct access tokens or more meaningful exception so we can act on our endScreenshots
N/a
Environment Information (please complete the following information):
Additional context
N/a
The text was updated successfully, but these errors were encountered: