Web Auth login automatic re-login after first login.
See original GitHub issueDescribe the problem you’d like to have solved
When the user accessed the app for the first time, what I do is I display a screen on the user with a button that says login, when the user taps on that button, I call the webAuth.authorize
like so:
const credentials = await auth0.webAuth.authorize({
scope: 'openid profile email read:current_user offline_access',
connection,
audience
});
When the user logs in again for the second time, we don’t want to display the login screen with that login button anymore, we just want to automatically log the user is. First approach that I did is to call auth0.webAuth.authorize
automatically when the app loads, but that didn’t went well as it seems to not do anything on ios, but on android that seems to work well, we still see the web page popup but it then goes down and returns the response to us.
Describe the ideal solution
like a method to automatically re-login without needing to open the login web page.
Alternatives and current work-arounds
Not sure.
Additional information, if any
References:
Tags: auto login, webAuth.authorize automatic login, auto re-login
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)
Top GitHub Comments
@aprilmintacpineda the issued at should be in the ID Token as the
iat
claim.The AT is not necessarily a JWT, for some cases it’s just an opaque string, so it’s not to be decoded. The response object contains a
expiresIn
property with a timestamp. That is the AT’s expiration. Then you should decode the ID Token (which is a JWT) and check the value of theexp
claim. So you need to check both expiration values.