Skip to content

OAuth2AccessTokenResponse.Builder does not set expiresAt from refresh token #8696

Closed
@MatCuk

Description

@MatCuk

Describe the bug
OAuth2RefreshToken always sets expiresAt to null
https://github.com/spring-projects/spring-security/blob/master/oauth2/oauth2-core/src/main/java/org/springframework/security/oauth2/core/OAuth2RefreshToken.java

To Reproduce
Have refresh token with "exp" field set.

Expected behavior
org.springframework.security.oauth2.core.OAuth2RefreshToken should have expiresAt set from JWT.

Sample
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiJtYXRjdWsiLCJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiYXRpIjoiZDcyMzgxNDUtMDIzZS00ZWMzLTk0MDItMzAyMDVjM2JlNGJjIiwiZXhwIjoxNTkyMzU2OTAzLCJqdGkiOiI1OTcxZWI3ZS1kOTYyLTRiZmMtODJmYS1kZDYyZTc2NjQ3ZGEifQ.QgQYBkOdkxzuulo9Ka0k9GlRRCXxY1WCTY52zF9Geg0

{ "user_name": "matcuk", "scope": [ "read", "write" ], "ati": "d7238145-023e-4ec3-9402-30205c3be4bc", "exp": 1592356903, "jti": "5971eb7e-d962-4bfc-82fa-dd62e76647da" }

So to me it looks like exp field is ignored in case of refresh token.

Note that access token would have different expiresAt (5 minutes vs 12 hours).

Metadata

Metadata

Assignees

Labels

in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)status: invalidAn issue that we don't feel is valid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions