-
Notifications
You must be signed in to change notification settings - Fork 6k
OAuth2AccessTokenResponse.expiresIn() is ignored when initialized from another response #8702
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
Comments
@benba It doesn't make sense to call |
@jgrandja sure, it's just that you need to copy all the entries manually: OAuth2AccessTokenResponse.withToken(accessToken.getTokenValue())
.tokenType(accessToken.getTokenType())
.scopes(accessToken.getScopes())
.expiresIn(Duration.ofDays(1).toSeconds())
.refreshToken(original.getRefreshToken().getTokenValue())
.additionalParameters(original.getAdditionalParameters())
.build(); Maybe I understand this wrong but I thought of the |
@benba I see your point...
However, throwing an exception would be too much I think. How about setting |
@jgrandja PR submitted |
Describe the bug
OAuth2AccessTokenResponse doesn't use values provided to
expiresIn()
method when it was originally built from a previous response (through thewithResponse()
method).Expected behavior
The newly created token response should update
expiresAt
using the value the provided toexpiresIn()
, or maybe throw an exception if keeping the originalexpiresAt
value is done on purpose.Sample
Note
May be linked to #8696 ?
The text was updated successfully, but these errors were encountered: