Skip to content

DefaultReactiveOAuth2AuthorizedClientManager never calls UnAuthenticatedServerOAuth2AuthorizedClientRepository #7544

Closed
@frzme

Description

@frzme

Summary

When using UnAuthenticatedServerOAuth2AuthorizedClientRepository together with the DefaultReactiveOAuth2AuthorizedClientManager authorized clients are not correctly loaded/saved.

This seems to relate to #7468 (@jgrandja )

It seems that when using the UnAuthenticatedServerOAuth2AuthorizedClientRepository it is (and can) never be called from DefaultReactiveOAuth2AuthorizedClientManager as it tries to flatMap a Mono<ServerWebExchange (in the method loadAuthorizedClient). In situations there UnAuthenticatedServerOAuth2AuthorizedClientRepository can/should be used the WebExchange well be null/empty the Mono will be empty and therefore the code in flatMap will not execute.
If ServerWebExchange would be present UnAuthenticatedServerOAuth2AuthorizedClientRepository would throw an Exception there therefore needs to be a way for the ClientManager to call the repository without a WebExchange.

Version

Spring Security 5.2.0 via Spring Boot 2.2.0

Metadata

Metadata

Assignees

Labels

in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)status: backportedAn issue that has been backported to maintenance branchestype: regressionA regression from a previous release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions