public abstract class AbstractTicketValidationFilter extends AbstractCasFilter
This filter can be configured with the following values:
redirectAfterValidation
- redirect the CAS client to the same URL without the ticket.
(default: true, Will be forced to false when useSession
is false.)exceptionOnValidationFailure
- throw an exception if the validation fails. Otherwise, continue
processing. (default: true)useSession
- store any of the useful information in a session attribute. (default: true)hostnameVerifier
- name of class implementing a HostnameVerifier
.hostnameVerifierConfig
- name of configuration class (constructor argument of verifier).CONST_CAS_ASSERTION
logger
Modifier | Constructor and Description |
---|---|
protected |
AbstractTicketValidationFilter(Protocol protocol) |
Modifier and Type | Method and Description |
---|---|
void |
doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain) |
protected HostnameVerifier |
getHostnameVerifier()
Gets the configured
HostnameVerifier to use for HTTPS connections
if one is configured for this filter. |
protected Properties |
getSSLConfig()
Gets the ssl config to use for HTTPS connections
if one is configured for this filter.
|
protected TicketValidator |
getTicketValidator(javax.servlet.FilterConfig filterConfig)
Template method to return the appropriate validator.
|
void |
init()
Initialization method.
|
protected void |
initInternal(javax.servlet.FilterConfig filterConfig)
Controls the ordering of filter initialization and checking by defining a method that runs before the init.
|
protected void |
onFailedValidation(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Template method that gets executed if validation fails.
|
protected void |
onSuccessfulValidation(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Assertion assertion)
Template method that gets executed if ticket validation succeeds.
|
protected boolean |
preFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
Pre-process the request before the normal filter process starts.
|
void |
setExceptionOnValidationFailure(boolean exceptionOnValidationFailure) |
void |
setRedirectAfterValidation(boolean redirectAfterValidation) |
void |
setTicketValidator(TicketValidator ticketValidator) |
void |
setUseSession(boolean useSession) |
constructServiceUrl, destroy, getProtocol, init, retrieveTicketFromRequest, setEncodeServiceUrl, setServerName, setService
getBoolean, getClass, getInt, getLong, getString, isIgnoreInitConfiguration, setIgnoreInitConfiguration
protected AbstractTicketValidationFilter(Protocol protocol)
protected TicketValidator getTicketValidator(javax.servlet.FilterConfig filterConfig)
filterConfig
- the FilterConfiguration that may be needed to construct a validator.protected Properties getSSLConfig()
protected HostnameVerifier getHostnameVerifier()
HostnameVerifier
to use for HTTPS connections
if one is configured for this filter.protected void initInternal(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
AbstractCasFilter
initInternal
in class AbstractCasFilter
filterConfig
- the original filter configuration.javax.servlet.ServletException
- if there is a problem.public void init()
AbstractCasFilter
init
in class AbstractCasFilter
protected boolean preFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain) throws IOException, javax.servlet.ServletException
servletRequest
- The servlet request.servletResponse
- The servlet response.filterChain
- the filter chain.IOException
- if there is an I/O problemjavax.servlet.ServletException
- if there is a servlet problem.protected void onSuccessfulValidation(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Assertion assertion)
request
- the HttpServletRequest.response
- the HttpServletResponse.assertion
- the successful Assertion from the server.protected void onFailedValidation(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
request
- the HttpServletRequest.response
- the HttpServletResponse.public final void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
public final void setTicketValidator(TicketValidator ticketValidator)
public final void setRedirectAfterValidation(boolean redirectAfterValidation)
public final void setExceptionOnValidationFailure(boolean exceptionOnValidationFailure)
public final void setUseSession(boolean useSession)
Copyright © 2006–2017 Jasig. All rights reserved.