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.

Ability to check if access token has expired without renewing the access token

See original GitHub issue

Request: an SDK method to check if access token has expired without renewing the access token.

  • Auth.currentSession()
  • Auth.currentAuthenticatedUser()

^ both of these methods expose an isValid function to check if access token is valid, but both call getSession which renews the access token.

The documentation indicates this is expected for currentSession, but doesn’t for currentAuthenticatedUser. It’s unclear if this is expected behavior or not. Regardless, it would be great to have an SDK method to check if the session is still valid without renewing the token. Right now it seems like the only option is to read from cookies directly and manually calculate expiration.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
elorzafecommented, Jul 1, 2022

@motzko @AlphaJuliettOmega @icapurro @zilahir @martinmicunda @sonphnt What is the use case you are trying to solve by only checking if the token is expired without having the library to renew the token?

0reactions
AllanZhengYPcommented, Nov 17, 2022

@martinmicunda Glad to see Hub is what you need. I will close this issue. Please feel free to open a new issue if you have further questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to identify if the OAuth token has expired? - Stack Overflow
The OAuth 2.0 standard, RFC 6749, defines the expires_in field as the number of seconds to expiration: expires_in: RECOMMENDED. The lifetime in ...
Read more >
Seemingly able to renew access_token with expired id_token
Hi, I'm trying to test what happens when my tokens expire in my app, so I'm purposely setting the timeouts low, but no...
Read more >
Solved: OAuth Refresh token has expired after 90 days
Note that AcquireTokenSilent DOES return a refresh token (valid for 90 days), and you should make sure you store this after every request....
Read more >
Troubleshoot AWS STS security token expired errors when ...
I tried to assume an AWS Identity and Access Management (IAM) role by using the AWS Command Line Interface (AWS CLI).
Read more >
Refresh Tokens - OAuth 2.0 Simplified
The presence of the refresh token means that the access token will expire and you'll be able to get a new one without...
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