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

Add support customizing the serverLogoutSuccessHandler for OidcClientInitiatedServerLogoutSuccessHandler #14808

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CrazyParanoid
Copy link

Closes gh-14778

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 27, 2024
@jzheaux jzheaux added in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: blocked An issue that's blocked on an external project change and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 1, 2024
@jzheaux jzheaux self-assigned this Apr 1, 2024
Copy link
Contributor

@jzheaux jzheaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @CrazyParanoid! I've left my feedback inline.

*/
public static class RedirectUriParameters {

private ServerWebExchange serverWebExchange;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have these be final and in the constructor

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add final to the class, but I'm not sure if it's worth making all the fields final and initializing them in the constructor. The DefaultRedirectUriResolver requires two attributes Authentication and ServerWebExchange and this attributes are passed to the onLogoutSuccess method, meaning they cannot be null, so they can be made final and added to the constructor, ClientRegistration will be found in the resolver (OidcClientInitiatedServerLogoutSuccessHandler. this.clientRegistrationRepository::findByRegistrationId). That is, it cannot be declared final and required to be initialized in the constructor. I can easily pass it via setter if I need another one ClientRegistration:

this.handler.setRedirectUriResolver((params) -> {
			params.setClientRegistration(ClientRegistration.withRegistrationId("clientId")
					.build());
			return Mono.just("URL");});

@jzheaux jzheaux added type: enhancement A general enhancement and removed status: blocked An issue that's blocked on an external project change labels Apr 25, 2024
@jzheaux jzheaux added this to the 6.4.0-M1 milestone Apr 26, 2024
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: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support customizing the redirect URL in OidcClientInitiatedServerLogoutSuccessHandler
3 participants