Skip to content

Configured TokenSettings.accessTokenTimeToLive() not used #172

@momrak

Description

@momrak

Describe the bug
Default and custom tokenSettings regarding time to live does not seem to be applied

To Reproduce
I am trying out the sample authorization server, client and resource server. In the AuthorizationServerConfig i tried setting the .tokenSettings(tokenSettings -> tokenSettings.accessTokenTimeToLive(Duration.ofSeconds(20))), and then debug the clients authorizationCodeGrant method to see the access and refresh token. I would then expect the difference between issuedAt and expiresAt to be 20 minutes. However it was always 1 hour. I then also tried this while not configuring the tokenTimeToLive, and the same duration was set then. I was able to disable the refresh token, so some of the settings seems to work.

Expected behavior
When setting .tokenSettings(tokenSettings -> tokenSettings.accessTokenTimeToLive(Duration.ofSeconds(20))) i expect the accessToken to have a validity of 20 sec. Same when configuring the refresh token. And if not configuring anything I expect to see default values of 5 and 60 mins respectively.

Sample
I used your sample repository. In the added screenshot you can see a photo of the debug session. I might have missed something here regarding the customization, but I am not able to figure out, so I decided to report this.
authServer

A link to a GitHub repository with a minimal, reproducible sample.

Reports that include a sample will take priority over reports that do not.
At times, we may require a sample, so it is good to try and include a sample up front.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions