-
Notifications
You must be signed in to change notification settings - Fork 210
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
Get credentials when device is offline and accessToken has expired #1026
Comments
@bledar Have you tried the |
@poovamraj this will work if the |
But how is the |
I have an application that is used in marine industri so the user can stay for several days without internet connection.
|
I'd suggest increasing the expiry of the access token as it can be a JWT, you can work with the expiry time from here.
I understand this is required for your use cases but I don't think the implementation logic is right here as Refresh Tokens are opaque that provide no authentication information offline.
This cannot be guaranteed with the existence of the Refresh token alone, as the expiry of refresh token can only be known by checking with the endpoint. I understand the doubt might stem from the fact that the scope to get Refresh Tokens are called Other similar questions on forum |
Increasing the access token might work but it is not ideal since I don't really know how much time user will use the app without connecting to the internet. Can be several days to several months. |
Checklist
Describe the problem you'd like to have solved
I have an application that needs to function even if the device has no internet connection. Initially the user has to login and set up the account when it is online. After initial login, all credentials are managed by Auth0 ReactNative SDK. When the user is online this works well. It will return an accessToken from credential manager. If the token has expired, it will renew using refresh token and return the new
accessToken
. The problem is when the user has no data connection. The Credential manager will not return anything ifaccessToken
has expired and there is no data connection.Describe the ideal solution
In my opinion it should return at least the
refreshToken
since this is still valid and can be used as soon as the user is online. Ideally it can return both, so I know user is logged in even if device is offline. The validity of theaccessToken
can be easily checked before use by checkingexpiredAt
date.Alternatives and current workarounds
At the moment I need to store the user data manually to storage since I can not rely on Auth0 ReactNative SDK when device is offline. This is not ideal since those data should be maintained manually that can lead to different errors and potential bugs.
Additional context
No response
The text was updated successfully, but these errors were encountered: