-
Notifications
You must be signed in to change notification settings - Fork 61
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
Validation of tokens doesn't consider OAuth2Config.tokenProvider.systemTime #700
Comments
@ybelMekk could you have a look? |
I tried to change like this xuanswe@1b74252
And provide the systemTime for all implementation of Most of them are fine with a direct parameter passing. I didn't try to do the same for the method IMO, we should somehow have a way to allow access the |
I see, I had the same idea, looking over the issue. could we do it a bit hacky like this?
Or the idea about direct access, not sure, need to have another go to see if it breaks anything? |
Yes, I like your idea, which is better than mine. The value should be derived from this.jwtClaimsSet itself. Nice! |
How about |
Oh, wait. I don't think we can use |
its should be the same as the systemTime, at the creation time in claimset? |
https://datatracker.ietf.org/doc/html/rfc6749#section-5.1
"from the time the response was generated" not "from the time the token was generated" |
Anyway, do you think the value of expires_in is used to validate the token expiration? |
I think you are talking past each other 😄
In your example the expectation is wrong: a token with 1 hour expiration will only be valid for 1 hour after it is issued, i.e. in 2020. So unless your validation code has changed its clock to the same as |
Thanks for your confirmation, @tommytroen!
Oh, do you mean that the mock server doesn't validate the expiration of the token, but the logic of the application does? Assume I change my application security logic to use the mock systemTime (2020), |
@xuanswe, hope u had a good summer 🌞 is this still an issue? |
Thanks @ybelMekk! Hope you enjoy your summer as well :). Yes, I am still waiting for your opinion on how to continue. Maybe we can just pass the configured systemTime everywhere for now if it works. What do you think? If you agree with this approach, I guess I can find time to work on it soon. |
@tommytroen Hope you enjoyed your vacation :-)
Amazing! I will try again and see if it can fix my test case. Thank you a lot! |
How to reproduce the bug
Additional Information
I found
Instant.now()
, which is still used at 2 places.I think it should be replaced by the value of getter
OAuth2Config.tokenProvider.systemTime
.The text was updated successfully, but these errors were encountered: