Skip to content
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

Cognito Auth isAuthenticated always returning false #813

Closed
rscmendes opened this issue Mar 23, 2019 · 7 comments
Closed

Cognito Auth isAuthenticated always returning false #813

rscmendes opened this issue Mar 23, 2019 · 7 comments
Assignees
Labels
bug Something isn't working closing soon Issue will auto-close if there is no additional activity within 7 days. cognito Issues with the AWS Android SDK for Cognito

Comments

@rscmendes
Copy link

Describe the bug
Function isAuthenticated() from cognitoauth returns always false even after successful login.

To Reproduce
Download and configure the cognitoauth sample for android https://github.com/awslabs/aws-sdk-android-samples.
Add the following line to the onSuccess of the AuthHandler:

Log.d(TAG, "Is user signed = " + auth.isAuthenticated());

Authenticate and see the logs. false is returned even after a successful login.

Which AWS service(s) are affected?
cognitoauth

Expected behavior
isAuthenticated() should return true after a successful login.

Environment Information (please complete the following information):

  • AWS Cognito Auth SDK Version: 2.12.+
  • Device: Simulator, but should occur in any
  • Android Version: 9.0 (haven't tried in others, but suspect that the same will occur)

Additional context
This only occurs in the latest version of cognito auth sdk (2.12.+). In version 2.11.+ isAuthenticated() works as expected.
Similar issue to #508 but that one was probably fixed long ago.

@minbi minbi self-assigned this Mar 25, 2019
@minbi minbi added bug Something isn't working cognito Issues with the AWS Android SDK for Cognito labels Mar 25, 2019
@minbi
Copy link
Contributor

minbi commented Mar 25, 2019

Hi @bluetrickpt ,

We'll need to investigate and report back. Thanks for the report.

@minbi
Copy link
Contributor

minbi commented Mar 28, 2019

It's not clear where the issue might be. I'm seeing a potential bug in the caching layer, but it does not explain why isAuthenticated() would be false if you are receiving a onSuccess callback. Both of those methods rely on the same mechanism to retrieve the tokens (which are used to determine isAuthenticated).

Are you migrating between 2.11.+ and 2.12.+ on the emulator?

@rscmendes
Copy link
Author

rscmendes commented Mar 31, 2019

When I first tested, I was migrating from 2.11.+ to 2.12.+ on the emulator. However, in a fresh virtual device (just created for this purpose), 2.12.+ also returns false. Just tested the same for API level 28 and 27 and the bug is present in both, so I'm assuming the API does not influence.

Were you not able to reproduce the bug? Thank you for looking into this.

@minbi
Copy link
Contributor

minbi commented Apr 3, 2019

We were not able to reproduce the issue. We did release a patch for one of the issues in the caching layer and also made the a suspected issue more apparent by throwing the exception. Please see SDK version 2.12.7 or 2.13.0

@minbi
Copy link
Contributor

minbi commented Apr 5, 2019

Hi @bluetrickpt ,

The previous statement is retracted. We were able to get a reproduction. We will have a fix soon.

@minbi minbi added the pending-release Code has been merged but pending release label Apr 5, 2019
@rohandubal
Copy link
Contributor

Hello @bluetrickpt

We have fixed this issue with SDK release 2.13.1. Please try it out and let us know if it works for you.

Best,
Rohan

@rohandubal rohandubal added closing soon Issue will auto-close if there is no additional activity within 7 days. and removed pending-release Code has been merged but pending release labels Apr 6, 2019
@stale stale bot removed the closing soon Issue will auto-close if there is no additional activity within 7 days. label Apr 6, 2019
@rohandubal rohandubal added the closing soon Issue will auto-close if there is no additional activity within 7 days. label Apr 6, 2019
@rscmendes
Copy link
Author

I confirm that the issue is fixed in 2.13.1.
Thank you very much for looking into this.
(Apologies for closing the issue before commenting)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working closing soon Issue will auto-close if there is no additional activity within 7 days. cognito Issues with the AWS Android SDK for Cognito
Projects
None yet
Development

No branches or pull requests

3 participants