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

♻️ Cached refresh tokens are not backed up #1118

Open
6 tasks
matt-goldman-ssw opened this issue Nov 18, 2024 · 0 comments
Open
6 tasks

♻️ Cached refresh tokens are not backed up #1118

matt-goldman-ssw opened this issue Nov 18, 2024 · 0 comments

Comments

@matt-goldman-ssw
Copy link
Contributor

Cc: @adamcogan @sethdaily @zacharykeeping

Hi @AntPolkanov

Pain

Adam has mentioned a few times that when he opens SSW Rewards after a long time, he can't log in automatically.

As per our conversation I suspect this may be related to the app getting offloaded due to inactivity. When an app is offloaded by the OS, its state is backed up first, but by default Secure Storage is not included in backups.

We should investigate this to see whether it can resolve the issue.

You also mentioned that previously we had explicitly excluded refresh tokens from backup as they would be expired by the time the app was restored. We should try to mitigate this though.

Related to that last point, we also have a small bug here:

We call SignInAsync when the refresh fails, however SignInAsync has prompt=login hardcoded. When calling this from the refresh method, we should try prompt=none first to attempt to authenticate silently. With this hardcoded, it will always prompt the user for credentials, even if they have a valid session.

What code could be improved?

We should ensure the refresh tokens are restored when an app is rehydrated after offloading. We should also ensure the app attempts to silently authenticate prior to prompting the user for credentials.

Tasks

  • Investigate backup of secure storage
  • Investigate offloading/rehydration and secure storage backups
  • Refactor the signin method to allow passing a flag to indicate whether silent authentication should be attempted first

Acceptance Criteria

More Information

You may also still need to investigate refresh token lifetime.

Screenshots

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant