Skip to content

OAuth2 client doesn't update token when refresh of token had failed #10016

Closed
@geobreze

Description

@geobreze

Describe the bug

We're using Spring security OAuth2 client with grant type password. It uses both access_token and refresh_token. When access_token expires, token tries to refresh and we're getting error from backend.

In this case, token is not refreshed and not removed from token repository and next call to API, tries to refresh token with same (wrong) refresh token, thus causing infinite loop for token refresh.

To Reproduce

Please, see attached sample.

Expected behavior

It's expected to get new access_token and refresh_token pair using grant type other than refresh_token when refresh had failed.

Sample

https://github.com/geobreze/oauth2-client-refresh-token-demo

Metadata

Metadata

Assignees

Labels

for: stackoverflowA question that's better suited to stackoverflow.com

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions