question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Web Auth login automatic re-login after first login.

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Widcketcommented, Feb 4, 2021

@aprilmintacpineda the issued at should be in the ID Token as the iat claim.

1reaction
Widcketcommented, Jan 29, 2021

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 the exp claim. So you need to check both expiration values.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Need to relogin web auth again and again - Cisco Community
Note: If clients are active after successful login, they will get de-authenticated and entry can still be removed from the controller after the...
Read more >
How to automatically login users after Email/Password ...
The problem I'm encountering is that my React component that handles the user confirmation, doesn't have access to the user instance's email and ......
Read more >
How to automatically re-login a user with a cookie
Your cookie should have three values: 1. username 2. expiration time 3. ... Store that session code and expiration time in the cookie...
Read more >
Authentication State Persistence | Firebase - Google
Calling a sign-in method after changing persistence will wait for that persistence change to complete before applying it on the new Auth state....
Read more >
Automatic sign-in and sign-out | Authentication
Sign in users automatically · the user must first be signed-in to their Google account and · have previously granted consent to share...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found