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

Preemptive Credentials refresh [SDK-1819] #349

Closed
skjolber opened this issue Sep 21, 2020 · 5 comments
Closed

Preemptive Credentials refresh [SDK-1819] #349

skjolber opened this issue Sep 21, 2020 · 5 comments
Labels
feature request A feature has been asked for or suggested by the community

Comments

@skjolber
Copy link

Describe the problem you'd like to have solved

We're building a ticket inspection app. We want to avoid interaction with the authorization server as much as possible during the inspection session, which can last from a few minutes to a few hours (all limited by the authorization server settings).

Describe the ideal solution

We would like preemptively refresh the access-token, and/or trigger a new (manual) login if the refresh-token is about to expire. Ideally some kind of forceRefresh parameter could be added and we would get the relevant timestamps from Credentials.

Alternatives and current work-arounds

Get the credentials, look at the id-token expire time, clear them if not acceptable.

Additional context

SecureCredentialsManager

@lbalmaceda
Copy link
Contributor

Hey @skjolber ! 👋 If I understand correctly what you're asking, you need the "Credentials Managers" to expose some way to manually refresh the tokens, even when they have not expired yet and shouldn't be refreshed. Is that correct?

If that's the case, one of the solutions we implemented in iOS and want to bring to Android as well is passing some TTL value on the getCredentials call, so that you can specify that you require an access token that will last for at least X (TTL) seconds.

Would a solution like that work for you? If so, I can link this issue to that card.

@lbalmaceda lbalmaceda added the waiting for customer This issue is waiting for a response from the issue or PR author label Sep 22, 2020
@skjolber
Copy link
Author

That is right. Yes, I think the TTL approach you're describing will work for us 👍

@lbalmaceda lbalmaceda changed the title Preemptive Credentials refresh Preemptive Credentials refresh [SDK-1819] Sep 25, 2020
@lbalmaceda
Copy link
Contributor

Excellent. Tracking under SDK-1819.

@lbalmaceda lbalmaceda added needs investigation An issue that has more questions to answer or otherwise needs work to fully understand the issue and removed waiting for customer This issue is waiting for a response from the issue or PR author labels Sep 25, 2020
@lbalmaceda
Copy link
Contributor

@skjolber the 2 PRs above add support for this in both credential managers. I'll have it released in the next minor.

@lbalmaceda
Copy link
Contributor

Feature added in PRs 363 and 369

@lbalmaceda lbalmaceda added feature request A feature has been asked for or suggested by the community and removed needs investigation An issue that has more questions to answer or otherwise needs work to fully understand the issue labels Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A feature has been asked for or suggested by the community
Projects
None yet
Development

No branches or pull requests

2 participants