Ability to check if access token has expired without renewing the access token
See original GitHub issueRequest: 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:
- Created 3 years ago
- Reactions:5
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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?
@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.