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

HostedUI uses cached configuration #2842

Closed
tjleing opened this issue Mar 21, 2022 · 1 comment · Fixed by #2946
Closed

HostedUI uses cached configuration #2842

tjleing opened this issue Mar 21, 2022 · 1 comment · Fixed by #2946
Assignees
Labels
bug Something isn't working cognito Issues with the AWS Android SDK for Cognito

Comments

@tjleing
Copy link
Contributor

tjleing commented Mar 21, 2022

Describe the bug
HostedUI configuration is loaded from SharedPreferences even when awsconfiguration.json is updated more recently. This can manifest in a verification error on one of the initialization fields, even after changing the config file.

To Reproduce

  1. Set up app with Hosted UI.
  2. Set a breakpoint on _showSignIn in AWSMobileClient.java, run the app and note that it uses the proper configuration blob.
  3. Update the awsconfiguration.json (and amplifyconfiguration.json -- you can run grep to make sure that there is no possible other source of backups), changing the WebDomain, for example.
  4. Re-run the app and note that the blob has not updated.
  5. Delete the virtual device and create a new one.
  6. Re-run the app and note that the blob has updated.

Which AWS service(s) are affected?
After looking through AWSMobileClient.java (search for mStore.get), it looks like the issue is just with Hosted UI.

Expected behavior
Hosted UI should load the proper configuration from awsconfiguration.json and trust it over the SharedPreferences configuration. I expect that this will just be a reordering of getHostedUIJSON(awsConfig).

@tjleing tjleing added bug Something isn't working cognito Issues with the AWS Android SDK for Cognito labels Mar 21, 2022
@banji180 banji180 self-assigned this Jun 9, 2022
@banji180
Copy link
Contributor

After following the steps above, I can see the updated change in the config used by the HostedUI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cognito Issues with the AWS Android SDK for Cognito
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants