public class CasAuthenticationEntryPoint extends Object implements org.springframework.security.web.AuthenticationEntryPoint, InitializingBean
ExceptionTranslationFilter to commence authentication via the
JA-SIG Central Authentication Service (CAS).
The user's browser will be redirected to the JA-SIG CAS enterprise-wide login page.
This page is specified by the loginUrl property. Once login is complete,
the CAS login page will redirect to the page indicated by the service
property. The service is a HTTP URL belonging to the current application.
The service URL is monitored by the CasAuthenticationFilter, which
will validate the CAS login was successful.
| Constructor and Description |
|---|
CasAuthenticationEntryPoint() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
commence(javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse response,
org.springframework.security.core.AuthenticationException authenticationException) |
protected String |
createRedirectUrl(String serviceUrl)
Constructs the Url for Redirection to the CAS server.
|
protected String |
createServiceUrl(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Constructs a new Service Url.
|
protected boolean |
getEncodeServiceUrlWithSessionId()
Sets whether to encode the service url with the session id or not.
|
String |
getLoginUrl()
The enterprise-wide CAS login URL.
|
ServiceProperties |
getServiceProperties() |
protected void |
preCommence(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Template method for you to do your own pre-processing before the redirect occurs.
|
void |
setEncodeServiceUrlWithSessionId(boolean encodeServiceUrlWithSessionId)
Sets whether to encode the service url with the session id or not.
|
void |
setLoginUrl(String loginUrl) |
void |
setServiceProperties(ServiceProperties serviceProperties) |
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic final void commence(javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse response,
org.springframework.security.core.AuthenticationException authenticationException)
throws IOException,
javax.servlet.ServletException
commence in interface org.springframework.security.web.AuthenticationEntryPointIOExceptionjavax.servlet.ServletExceptionprotected String createServiceUrl(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
request - the HttpServletRequestresponse - the HttpServlet Responseprotected String createRedirectUrl(String serviceUrl)
serviceUrl - the service url that should be included.protected void preCommence(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
request - the HttpServletRequestresponse - the HttpServletResponsepublic final String getLoginUrl()
https://www.mycompany.com/cas/login.public final ServiceProperties getServiceProperties()
public final void setLoginUrl(String loginUrl)
public final void setServiceProperties(ServiceProperties serviceProperties)
public final void setEncodeServiceUrlWithSessionId(boolean encodeServiceUrlWithSessionId)
encodeServiceUrlWithSessionId - whether to encode the service url with the
session id or not.protected boolean getEncodeServiceUrlWithSessionId()