You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For apps which are designed around the user being offline frequently, the following flow would be great:
user is logged in
user goes offline
user returns to the app while offline, access token expired
user can continue to browse the app with their identity in the state they last saw it
upon coming back online, access token refresh happens
Currently, this is harder to achieve because credentials of DefaultCredentialsManager will always try to refresh the token, which fails without internet. Since this is the only method which access credentials, there is no way to just get the cached (expired) credentials. This would be convenient to have so that in the offline state, we can still restore the users id/roles/permissions as to what they should be able to view in that offline state.
Describe the ideal solution
Add a method to CredentialsManager to get the cached credentials, without any attempt to refresh them. Or, add a boolean to the input of CredentialsManager.credentials to do the same behavior.
Alternatives and current workarounds
Alternatively it would be possible to cache the users id/roles/permissions ourselves to use in the app during the offline state. But this would be redundant with the credentials already in the manager, if we could access them.
It would also be possible to write our own implementation of credentials manager, to returns expired credentials from credentials if it fails to refresh while offline. But it defeats the purpose of the default manager to need to re-write the api calls to refresh the tokens and such
Additional context
No response
The text was updated successfully, but these errors were encountered:
Checklist
Describe the problem you'd like to have solved
For apps which are designed around the user being offline frequently, the following flow would be great:
Currently, this is harder to achieve because
credentials
ofDefaultCredentialsManager
will always try to refresh the token, which fails without internet. Since this is the only method which access credentials, there is no way to just get the cached (expired) credentials. This would be convenient to have so that in the offline state, we can still restore the users id/roles/permissions as to what they should be able to view in that offline state.Describe the ideal solution
Add a method to
CredentialsManager
to get the cached credentials, without any attempt to refresh them. Or, add a boolean to the input ofCredentialsManager.credentials
to do the same behavior.Alternatives and current workarounds
Alternatively it would be possible to cache the users id/roles/permissions ourselves to use in the app during the offline state. But this would be redundant with the credentials already in the manager, if we could access them.
It would also be possible to write our own implementation of credentials manager, to returns expired credentials from
credentials
if it fails to refresh while offline. But it defeats the purpose of the default manager to need to re-write the api calls to refresh the tokens and suchAdditional context
No response
The text was updated successfully, but these errors were encountered: