public class SAMLLogoutProcessingFilter
extends org.springframework.security.web.authentication.logout.LogoutFilter
Modifier and Type | Field and Description |
---|---|
protected SAMLContextProvider |
contextProvider |
static String |
FILTER_URL
Default processing URL.
|
protected static org.slf4j.Logger |
log
Class logger.
|
protected SingleLogoutProfile |
logoutProfile |
protected SAMLProcessor |
processor |
protected SAMLLogger |
samlLogger |
protected org.opensaml.common.binding.decoding.URIComparator |
uriComparator |
Constructor and Description |
---|
SAMLLogoutProcessingFilter(org.springframework.security.web.authentication.logout.LogoutSuccessHandler logoutSuccessHandler,
org.springframework.security.web.authentication.logout.LogoutHandler... handlers)
Constructor uses custom implementation for determining URL to redirect after successful logout.
|
SAMLLogoutProcessingFilter(String logoutSuccessUrl,
org.springframework.security.web.authentication.logout.LogoutHandler... handlers)
Constructor defines URL to redirect to after successful logout and handlers.
|
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Verifies that required entities were autowired or set.
|
void |
doFilter(ServletRequest req,
ServletResponse res,
FilterChain chain) |
String |
getFilterProcessesUrl()
Gets the URL used to determine if this Filter is invoked
|
protected String |
getProfileName()
Name of the profile processed by this class.
|
void |
processLogout(HttpServletRequest request,
HttpServletResponse response,
FilterChain chain)
Filter loads SAML message from the request object and processes it.
|
protected boolean |
requiresLogout(HttpServletRequest request,
HttpServletResponse response)
The filter will be used in case the URL of the request contains the DEFAULT_FILTER_URL.
|
void |
setContextProvider(SAMLContextProvider contextProvider)
Sets entity responsible for populating local entity context data.
|
void |
setFilterProcessesUrl(String filterProcessesUrl)
Sets the URL used to determine if this Filter is invoked
|
void |
setLogoutProfile(SingleLogoutProfile logoutProfile)
Profile for consumption of processed messages, must be set.
|
void |
setSamlLogger(SAMLLogger samlLogger)
Logger for SAML events, must be set.
|
void |
setSAMLProcessor(SAMLProcessor processor)
Object capable of parse SAML messages from requests, must be set.
|
void |
setUriComparator(org.opensaml.common.binding.decoding.URIComparator uriComparator)
Sets URI comparator used to get local entity endpoint
|
setLogoutRequestMatcher
protected SAMLProcessor processor
protected SingleLogoutProfile logoutProfile
protected SAMLLogger samlLogger
protected SAMLContextProvider contextProvider
protected org.opensaml.common.binding.decoding.URIComparator uriComparator
protected static final org.slf4j.Logger log
public static final String FILTER_URL
public SAMLLogoutProcessingFilter(String logoutSuccessUrl, org.springframework.security.web.authentication.logout.LogoutHandler... handlers)
logoutSuccessUrl
- user will be redirected to the url after successful logouthandlers
- handlers to invoke after logoutpublic SAMLLogoutProcessingFilter(org.springframework.security.web.authentication.logout.LogoutSuccessHandler logoutSuccessHandler, org.springframework.security.web.authentication.logout.LogoutHandler... handlers)
logoutSuccessHandler
- custom implementation of the logout logichandlers
- handlers to invoke after logoutpublic void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException
doFilter
in interface Filter
doFilter
in class org.springframework.security.web.authentication.logout.LogoutFilter
IOException
ServletException
public void processLogout(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException
In case the LogoutRequest message is received it will be verified and local session will be destroyed.
request
- http requestresponse
- http responsechain
- chainIOException
- errorServletException
- errorprotected String getProfileName()
protected boolean requiresLogout(HttpServletRequest request, HttpServletResponse response)
requiresLogout
in class org.springframework.security.web.authentication.logout.LogoutFilter
request
- request used to determine whether to enable this filter@Autowired public void setSAMLProcessor(SAMLProcessor processor)
processor
- processor@Autowired public void setLogoutProfile(SingleLogoutProfile logoutProfile)
logoutProfile
- profile@Autowired public void setSamlLogger(SAMLLogger samlLogger)
samlLogger
- logger@Autowired public void setContextProvider(SAMLContextProvider contextProvider)
contextProvider
- provider implementation@Autowired(required=false) public void setUriComparator(org.opensaml.common.binding.decoding.URIComparator uriComparator)
uriComparator
- URI comparatorSAMLUtil.getEndpoint(List, String, InTransport, URIComparator)
public void afterPropertiesSet() throws ServletException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class org.springframework.web.filter.GenericFilterBean
ServletException
public void setFilterProcessesUrl(String filterProcessesUrl)
setFilterProcessesUrl
in class org.springframework.security.web.authentication.logout.LogoutFilter
filterProcessesUrl
- the URL used to determine if this Filter is invokedpublic String getFilterProcessesUrl()