org.acegisecurity.captcha
Class CaptchaEntryPoint

java.lang.Object
  extended by org.acegisecurity.captcha.CaptchaEntryPoint
All Implemented Interfaces:
ChannelEntryPoint, org.springframework.beans.factory.InitializingBean

public class CaptchaEntryPoint
extends java.lang.Object
implements ChannelEntryPoint, org.springframework.beans.factory.InitializingBean

The captcha entry point : redirect to the captcha test page.

This entry point can force the use of SSL : see getForceHttps()

This entry point allows internal OR external redirect : see setOutsideWebApp(boolean)
/ Original request can be added to the redirect path using a custom translation : see setIncludeOriginalRequest(boolean)
The original request is translated using URLEncoding and the following translation mapping in the redirect url :



Default values :
 forceHttps = false
 includesOriginalRequest = true
 includesOriginalParameters = false
 isOutsideWebApp = false
 originalRequestUrlParameterName = original_requestUrl
 originalRequestParametersParameterName = original_request_parameters
 originalRequestParametersNameValueSeparator = __
 originalRequestParametersSeparator = ;;
 originalRequestMethodParameterName = original_request_method
 urlEncodingCharset = UTF-8
 

Version:
$Id: CaptchaEntryPoint.java 1784 2007-02-24 21:00:24Z luke_t $
Author:
marc antoine Garrigue

Constructor Summary
CaptchaEntryPoint()
           
 
Method Summary
 void afterPropertiesSet()
           
 void commence(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
          Commences a secure channel.
 java.lang.String getCaptchaFormUrl()
          DOCUMENT ME!
 boolean getForceHttps()
           
 java.lang.String getOriginalRequestMethodParameterName()
           
 java.lang.String getOriginalRequestParametersNameValueSeparator()
           
 java.lang.String getOriginalRequestParametersParameterName()
           
 java.lang.String getOriginalRequestParametersSeparator()
           
 java.lang.String getOriginalRequestUrlParameterName()
           
 PortMapper getPortMapper()
           
 PortResolver getPortResolver()
           
 java.lang.String getUrlEncodingCharset()
           
 boolean isIncludeOriginalParameters()
           
 boolean isIncludeOriginalRequest()
           
 boolean isOutsideWebApp()
           
 void setCaptchaFormUrl(java.lang.String captchaFormUrl)
          The URL where the CaptchaProcessingFilter login page can be found.
 void setForceHttps(boolean forceHttps)
          Set to true to force captcha form access to be via https.
 void setIncludeOriginalParameters(boolean includeOriginalParameters)
           
 void setIncludeOriginalRequest(boolean includeOriginalRequest)
          If set to true, the original request url will be appended to the redirect url using the getOriginalRequestUrlParameterName().
 void setOriginalRequestMethodParameterName(java.lang.String originalRequestMethodParameterName)
           
 void setOriginalRequestParametersNameValueSeparator(java.lang.String originalRequestParametersNameValueSeparator)
           
 void setOriginalRequestParametersParameterName(java.lang.String originalRequestParametersParameterName)
           
 void setOriginalRequestParametersSeparator(java.lang.String originalRequestParametersSeparator)
           
 void setOriginalRequestUrlParameterName(java.lang.String originalRequestUrlParameterName)
           
 void setOutsideWebApp(boolean isOutsideWebApp)
          if set to true, the commence(ServletRequest, ServletResponse) method uses the getCaptchaFormUrl() as a complete URL, else it as a 'inside WebApp' path.
 void setPortMapper(PortMapper portMapper)
           
 void setPortResolver(PortResolver portResolver)
           
 void setUrlEncodingCharset(java.lang.String urlEncodingCharset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CaptchaEntryPoint

public CaptchaEntryPoint()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

commence

public void commence(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response)
              throws java.io.IOException,
                     javax.servlet.ServletException
Description copied from interface: ChannelEntryPoint
Commences a secure channel.

Implementations should modify the headers on the ServletResponse as necessary to commence the user agent using the implementation's supported channel type.

Specified by:
commence in interface ChannelEntryPoint
Parameters:
request - that a ChannelProcessor has rejected
response - so that the user agent can begin using a new channel
Throws:
java.io.IOException - DOCUMENT ME!
javax.servlet.ServletException - DOCUMENT ME!

getCaptchaFormUrl

public java.lang.String getCaptchaFormUrl()
DOCUMENT ME!

Returns:
the captcha test page to redirect to.

getForceHttps

public boolean getForceHttps()

getOriginalRequestMethodParameterName

public java.lang.String getOriginalRequestMethodParameterName()

getOriginalRequestParametersNameValueSeparator

public java.lang.String getOriginalRequestParametersNameValueSeparator()

getOriginalRequestParametersParameterName

public java.lang.String getOriginalRequestParametersParameterName()

getOriginalRequestParametersSeparator

public java.lang.String getOriginalRequestParametersSeparator()

getOriginalRequestUrlParameterName

public java.lang.String getOriginalRequestUrlParameterName()

getPortMapper

public PortMapper getPortMapper()

getPortResolver

public PortResolver getPortResolver()

getUrlEncodingCharset

public java.lang.String getUrlEncodingCharset()

isIncludeOriginalParameters

public boolean isIncludeOriginalParameters()

isIncludeOriginalRequest

public boolean isIncludeOriginalRequest()

isOutsideWebApp

public boolean isOutsideWebApp()

setCaptchaFormUrl

public void setCaptchaFormUrl(java.lang.String captchaFormUrl)
The URL where the CaptchaProcessingFilter login page can be found. Should be relative to the web-app context path, and include a leading /

Parameters:
captchaFormUrl -

setForceHttps

public void setForceHttps(boolean forceHttps)
Set to true to force captcha form access to be via https. If this value is ture (the default is false), and the incoming request for the protected resource which triggered the interceptor was not already https, then

Parameters:
forceHttps -

setIncludeOriginalParameters

public void setIncludeOriginalParameters(boolean includeOriginalParameters)

setIncludeOriginalRequest

public void setIncludeOriginalRequest(boolean includeOriginalRequest)
If set to true, the original request url will be appended to the redirect url using the getOriginalRequestUrlParameterName().

Parameters:
includeOriginalRequest -

setOriginalRequestMethodParameterName

public void setOriginalRequestMethodParameterName(java.lang.String originalRequestMethodParameterName)

setOriginalRequestParametersNameValueSeparator

public void setOriginalRequestParametersNameValueSeparator(java.lang.String originalRequestParametersNameValueSeparator)

setOriginalRequestParametersParameterName

public void setOriginalRequestParametersParameterName(java.lang.String originalRequestParametersParameterName)

setOriginalRequestParametersSeparator

public void setOriginalRequestParametersSeparator(java.lang.String originalRequestParametersSeparator)

setOriginalRequestUrlParameterName

public void setOriginalRequestUrlParameterName(java.lang.String originalRequestUrlParameterName)

setOutsideWebApp

public void setOutsideWebApp(boolean isOutsideWebApp)
if set to true, the commence(ServletRequest, ServletResponse) method uses the getCaptchaFormUrl() as a complete URL, else it as a 'inside WebApp' path.

Parameters:
isOutsideWebApp -

setPortMapper

public void setPortMapper(PortMapper portMapper)

setPortResolver

public void setPortResolver(PortResolver portResolver)

setUrlEncodingCharset

public void setUrlEncodingCharset(java.lang.String urlEncodingCharset)


Copyright © 2004-2011 Interface21, Inc. All Rights Reserved.