public class LogoutConfigurer extends org.springframework.security.config.annotation.SecurityConfigurerAdapter<Void,ServiceProviderBuilder>
Builder configurer that takes care of configuring/customizing the SAMLLogoutFilter bean and
SAMLLogoutProcessingFilter bean.
This configurer always instantiates its own SAMLLogoutFilter and SAMLLogoutProcessingFilter based on
the specified configuration.
This configurer also reads the values from SAMLSSOProperties#getLogout() for some the DSL methods if they
are
not used. In other words, the user is able to configure the filters through the following properties:
saml.sso.logout.default-target-url
saml.sso.logout.logout-url
saml.sso.logout.single-logout-url
saml.sso.logout.clear-authentication
saml.sso.logout.invalidate-session
| Constructor and Description |
|---|
LogoutConfigurer() |
| Modifier and Type | Method and Description |
|---|---|
LogoutConfigurer |
clearAuthentication(Boolean value)
If true, removes the Authentication from the SecurityContext to prevent issues with concurrent requests.
|
void |
configure(ServiceProviderBuilder builder) |
protected org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler |
createDefaultGlobalHandler() |
protected org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler |
createDefaultLocalHandler() |
protected org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler |
createDefaultSuccessHandler() |
LogoutConfigurer |
defaultTargetURL(String url)
Supplies the default target Url that will be used if no saved request is found in the session, or the
alwaysUseDefaultTargetUrl property is set to true.
|
LogoutConfigurer |
globalHandler(org.springframework.security.web.authentication.logout.LogoutHandler handler)
Handler to be invoked when global logout is selected.
|
void |
init(ServiceProviderBuilder builder) |
LogoutConfigurer |
invalidateSession(Boolean value)
Causes the HttpSession to be invalidated when this LogoutHandler is invoked.
|
LogoutConfigurer |
localHandler(org.springframework.security.web.authentication.logout.LogoutHandler handler)
Handler to be invoked when local logout is selected.
|
LogoutConfigurer |
logoutURL(String url)
Sets the URL used to determine if the
SAMLLogoutFilter is invoked. |
LogoutConfigurer |
singleLogoutURL(String url)
Sets the URL used to determine if the
SAMLLogoutProcessingFilter is invoked. |
LogoutConfigurer |
successHandler(org.springframework.security.web.authentication.logout.LogoutSuccessHandler handler)
Handler to be invoked upon successful logout.
|
public void init(ServiceProviderBuilder builder) throws Exception
init in interface org.springframework.security.config.annotation.SecurityConfigurer<Void,ServiceProviderBuilder>init in class org.springframework.security.config.annotation.SecurityConfigurerAdapter<Void,ServiceProviderBuilder>Exceptionpublic void configure(ServiceProviderBuilder builder) throws Exception
configure in interface org.springframework.security.config.annotation.SecurityConfigurer<Void,ServiceProviderBuilder>configure in class org.springframework.security.config.annotation.SecurityConfigurerAdapter<Void,ServiceProviderBuilder>Exceptionprotected org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler createDefaultLocalHandler()
protected org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler createDefaultGlobalHandler()
protected org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler createDefaultSuccessHandler()
public LogoutConfigurer defaultTargetURL(String url)
"/". Not relevant if successHandler(LogoutSuccessHandler) is used.
Alternatively use property:
saml.sso.logout.default-target-url
url - the default target URLpublic LogoutConfigurer logoutURL(String url)
SAMLLogoutFilter is invoked.
Default is "/saml/logout".
Alternatively use property:
saml.sso.logout.logout-url
url - the url used to invoke the SAMLLogoutFilter.public LogoutConfigurer singleLogoutURL(String url)
SAMLLogoutProcessingFilter is invoked.
Default is "/saml/SingleLogout".
Alternatively use property:
saml.sso.logout.single-logout-url
url - the url used to invoke the SAMLLogoutProcessingFilter.public LogoutConfigurer clearAuthentication(Boolean value)
true. Not relevant if localHandler(LogoutHandler) is used.
Alternatively use property:
saml.sso.logout.clear-authentication
value - true if you wish to clear the Authentication from the SecurityContext (default) or false if the
Authentication
should not be removed.public LogoutConfigurer invalidateSession(Boolean value)
false. Not relevant if localHandler(LogoutHandler) is used.
Alternatively use property:
saml.sso.logout.invalidate-session
value - true if you wish the session to be invalidated or false (default) if it should not be.public LogoutConfigurer successHandler(org.springframework.security.web.authentication.logout.LogoutSuccessHandler handler)
defaultTargetURL(String).handler - the handler to invoke upon successful logout.public LogoutConfigurer localHandler(org.springframework.security.web.authentication.logout.LogoutHandler handler)
clearAuthentication and
invalidateSession for local logout.handler - the handler to be invoked.public LogoutConfigurer globalHandler(org.springframework.security.web.authentication.logout.LogoutHandler handler)
clearAuthentication and
invalidateSession for global logout.handler - the handler to be invoked.Copyright © 2018. All rights reserved.