-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Old JWT Tokens being presented to the API #95
Comments
I have managed to replicate a similar (same?) scenario with the frontend. I'm tacking the token in the HTTP middleware, both when the request is sent ( What's happening is this:
The backend logs the following item:
clearly not recognising the current token as valid The above scenario seems totally correct to me: there is no reason to indicate that the current token in store in the front is in any way invalid. What happens to the backend JWT Provider when the system is shut down? I'm obviously expecting a loss of persistence (in memory storage?) so not surprised if I'm forced out at restart. But what happens during the scenarios we have seen, where there was clearly no backend shutdown? Is there any case where the JWT Provider might lose its persistent state? |
Thanks for the analysis. The backend shouldn't required to store the token. |
The backend error message states that The payload is okay since it hasn't changed and the token is still before the expiry time (I've decoded it and check the So maybe the backend JWT provider doesn't; recognise the signature since the private or public key has changed due to the restart? If that's the case, could it also happen during a "normal" session? |
Incidentally, the frontend, thanks to |
JWE Tokens are only valid in the runtime that generated them, and they will NOT survive a restart since we have no persistence. The observed behaviour of the API is functionally correct. In this instance, the correct API or UI behaviour would be to observe the 401 and regenerate a token (based on a fresh login). |
Question - "... So maybe the backend JWT provider doesn't; recognise the signature since the private or public key has changed due to the restart? If that's the case, could it also happen during a "normal" session?" It wouldn't be "normal" for this to occur during a session, however, we need to allow for the fact that the presented JWT could be considered invalid at any point by the API server for any number of reasons. |
Descoping for .6 release since the issue is still not clear. Can be rescoped for .7 with addition of the re-issuance filter. |
Over a number of weeks I have seen behaviour (seemingly after a CRUD event) where the browser suddenly logs out. There seems to be no obvious reason for this, as the JWT is only a few minutes old.
Today I captured the event in logs where a previously issued JWE was presented to the API and rejected (causing the logout event).
Please see the log attached where a JWT is issues at the start of the session, then on a subsequent operation a previous token is presented.
The text was updated successfully, but these errors were encountered: