Class OidcClientInitiatedServerLogoutSuccessHandler
java.lang.Object
org.springframework.security.oauth2.client.oidc.web.server.logout.OidcClientInitiatedServerLogoutSuccessHandler
- All Implemented Interfaces:
org.springframework.security.web.server.authentication.logout.ServerLogoutSuccessHandler
public class OidcClientInitiatedServerLogoutSuccessHandler
extends Object
implements org.springframework.security.web.server.authentication.logout.ServerLogoutSuccessHandler
A reactive logout success handler for initiating OIDC logout through the user agent.
- Since:
- 5.2
- See Also:
-
- RP-Initiated Logout
ServerLogoutSuccessHandler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classParameters, required for redirect URI resolving. -
Constructor Summary
ConstructorsConstructorDescriptionOidcClientInitiatedServerLogoutSuccessHandler(ReactiveClientRegistrationRepository clientRegistrationRepository) Constructs anOidcClientInitiatedServerLogoutSuccessHandlerwith the provided parameters -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void>onLogoutSuccess(org.springframework.security.web.server.WebFilterExchange exchange, org.springframework.security.core.Authentication authentication) voidsetLogoutSuccessUrl(URI logoutSuccessUrl) The URL to redirect to after successfully logging out when not originally an OIDC loginvoidsetPostLogoutRedirectUri(String postLogoutRedirectUri) Set the post logout redirect uri template.voidsetRedirectStrategy(org.springframework.security.web.server.ServerRedirectStrategy redirectStrategy) Set theServerRedirectStrategyto use, defaultDefaultServerRedirectStrategyvoidsetRedirectUriResolver(org.springframework.core.convert.converter.Converter<OidcClientInitiatedServerLogoutSuccessHandler.RedirectUriParameters, reactor.core.publisher.Mono<String>> redirectUriResolver) Set theConverterthat convertsOidcClientInitiatedServerLogoutSuccessHandler.RedirectUriParametersto redirect URI
-
Constructor Details
-
OidcClientInitiatedServerLogoutSuccessHandler
public OidcClientInitiatedServerLogoutSuccessHandler(ReactiveClientRegistrationRepository clientRegistrationRepository) Constructs anOidcClientInitiatedServerLogoutSuccessHandlerwith the provided parameters- Parameters:
clientRegistrationRepository- TheReactiveClientRegistrationRepositoryto use to derive the end_session_endpoint value
-
-
Method Details
-
onLogoutSuccess
public reactor.core.publisher.Mono<Void> onLogoutSuccess(org.springframework.security.web.server.WebFilterExchange exchange, org.springframework.security.core.Authentication authentication) - Specified by:
onLogoutSuccessin interfaceorg.springframework.security.web.server.authentication.logout.ServerLogoutSuccessHandler
-
setPostLogoutRedirectUri
Set the post logout redirect uri template.
The supported uri template variables are:{baseScheme},{baseHost},{basePort}and{basePath}.
NOTE:{baseUrl}is also supported, which is the same as"{baseScheme}://{baseHost}{basePort}{basePath}"handler.setPostLogoutRedirectUri("{baseUrl}");will make so thatpost_logout_redirect_uriwill be set to the base url for the client application.- Parameters:
postLogoutRedirectUri- - A template for creating thepost_logout_redirect_uriquery parameter- Since:
- 5.3
-
setLogoutSuccessUrl
The URL to redirect to after successfully logging out when not originally an OIDC login- Parameters:
logoutSuccessUrl- the url to redirect to. Default is "/login?logout".
-
setRedirectUriResolver
public void setRedirectUriResolver(org.springframework.core.convert.converter.Converter<OidcClientInitiatedServerLogoutSuccessHandler.RedirectUriParameters, reactor.core.publisher.Mono<String>> redirectUriResolver) Set theConverterthat convertsOidcClientInitiatedServerLogoutSuccessHandler.RedirectUriParametersto redirect URI- Parameters:
redirectUriResolver-Converter- Since:
- 6.5
-
setRedirectStrategy
public void setRedirectStrategy(org.springframework.security.web.server.ServerRedirectStrategy redirectStrategy) Set theServerRedirectStrategyto use, defaultDefaultServerRedirectStrategy- Parameters:
redirectStrategy-ServerRedirectStrategy- Since:
- 6.5
-