JWT token expiration
See original GitHub issueI’m getting this error after Firebase JWT token expires (1 hour):
{"graphQLErrors":[],"networkError":{"response":{},"statusCode":400,"result":{"errors":[{"path":"$","error":"Could not verify JWT: JWTExpired","code":"invalid-jwt"}]}},"message":"Network error: Response not successful: Received status code 400"}
Docs mention that graphql-engine will refresh the JWKs automatically. Is there some setting I’m missing?
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Managing JWT token expiration - Medium
A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data. Quoted from...
Read more >What are Refresh Tokens and How They Interact with JWTs?
Authentication is implemented through JWT access tokens along with refresh tokens. The API returns a short-lived token (JWT), which expires in 15 minutes, ......
Read more >How to deal with JWT expiration? - Discover gists · GitHub
A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data. Quoted from...
Read more >How long JWT token valid ? - GeeksforGeeks
Syntax: · Parameters: · Return type: This method will return JWT token · Example: Creating a token with 10 minutes expiry. · Step...
Read more >authentication - Time expiration issue in JWT - Stack Overflow
In session based, of course there is a expiration time. So if user is not active for a while, his session get expired....
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 Free
Top 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
@pyankoff I solved the problem, it was caused by a silly thing: I had a test
console.error
left in case of subscription error. In react-native development mode, this becomes a fatal error, and it was thrown before the SDK refreshed the tokens. W/o this, the SDK keeps the tokens up to date. Which means your code also works for long-running subscriptions. But, on a side note, I think a better approach is to set theconnectionParams
on theWebSocketLink
, to avoid fetching a new token for each new request Thanks for the help!Yeah, using firebase. I’m getting the firebase token on every request:
const token = await user.getIdToken()
. Not sure it will fix the 1h problem, but here is my code using Apollo: