Skip to content
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

DefaultReactiveOAuth2AuthorizedClientManager.saveAuthorizedClient does not save authorized client #7546

Closed
philsttr opened this issue Oct 18, 2019 · 0 comments
Assignees
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: bug A general bug
Milestone

Comments

@philsttr
Copy link
Contributor

Summary

DefaultReactiveOAuth2AuthorizedClientManager.saveAuthorizedClient never actually saves the authorized client, because it ignores the Mono<Void> returned from authorizedClientRepository.saveAuthorizedClient

Actual Behavior

DefaultReactiveOAuth2AuthorizedClientManager.saveAuthorizedClient does not save the authorized client.

.map(exchange -> {
this.authorizedClientRepository.saveAuthorizedClient(authorizedClient, principal, exchange);
return authorizedClient;
})

this.authorizedClientRepository.saveAuthorizedClient returns a Mono<Void>, which is ignored, and never included in the stream, and therefore never subscribed.

Expected Behavior

DefaultReactiveOAuth2AuthorizedClientManager.saveAuthorizedClient saves the authorized client.

Perhaps:

	.flatMap(exchange -> 
		this.authorizedClientRepository.saveAuthorizedClient(authorizedClient, principal, exchange)
			.thenReturn(authorizedClient))

Configuration

n/a

Version

Spring Boot 2.2.0.RELEASE
Spring Security 5.2.0.RELEASE

Sample

n/a

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 18, 2019
@jgrandja jgrandja self-assigned this Oct 23, 2019
@jgrandja jgrandja added in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 23, 2019
@jgrandja jgrandja added this to the 5.2.1 milestone Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants