org.acegisecurity.ui.webapp
Class AuthenticationProcessingFilterEntryPoint

java.lang.Object
  extended by org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint
All Implemented Interfaces:
AuthenticationEntryPoint, InitializingBean

public class AuthenticationProcessingFilterEntryPoint
extends Object
implements AuthenticationEntryPoint, InitializingBean

Used by the SecurityEnforcementFilter to commence authentication via the AuthenticationProcessingFilter. This object holds the location of the login form, relative to the web app context path, and is used to commence a redirect to that form.

By setting the forceHttps property to true, you may configure the class to force the protocol used for the login form to be HTTPS, even if the original intercepted request for a resource used the HTTP protocol. When this happens, after a successful login (via HTTPS), the original resource will still be accessed as HTTP, via the original request URL. For the forced HTTPS feature to work, the PortMapper is consulted to determine the HTTP:HTTPS pairs.

Version:
$Id: AuthenticationProcessingFilterEntryPoint.java,v 1.11 2005/11/17 00:55:50 benalex Exp $
Author:
Ben Alex, colin sampaleanu, Omri Spector

Constructor Summary
AuthenticationProcessingFilterEntryPoint()
           
 
Method Summary
 void afterPropertiesSet()
           
 void commence(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, AuthenticationException authException)
          Commences an authentication scheme.
 boolean getForceHttps()
           
 String getLoginFormUrl()
           
 PortMapper getPortMapper()
           
 PortResolver getPortResolver()
           
 void setForceHttps(boolean forceHttps)
          Set to true to force login form access to be via https.
 void setLoginFormUrl(String loginFormUrl)
          The URL where the AuthenticationProcessingFilter login page can be found.
 void setPortMapper(PortMapper portMapper)
           
 void setPortResolver(PortResolver portResolver)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationProcessingFilterEntryPoint

public AuthenticationProcessingFilterEntryPoint()
Method Detail

setForceHttps

public void setForceHttps(boolean forceHttps)
Set to true to force login 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 -

getForceHttps

public boolean getForceHttps()

setLoginFormUrl

public void setLoginFormUrl(String loginFormUrl)
The URL where the AuthenticationProcessingFilter login page can be found. Should be relative to the web-app context path, and include a leading /

Parameters:
loginFormUrl -

getLoginFormUrl

public String getLoginFormUrl()

setPortMapper

public void setPortMapper(PortMapper portMapper)

getPortMapper

public PortMapper getPortMapper()

setPortResolver

public void setPortResolver(PortResolver portResolver)

getPortResolver

public PortResolver getPortResolver()

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

commence

public void commence(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     AuthenticationException authException)
              throws IOException,
                     javax.servlet.ServletException
Description copied from interface: AuthenticationEntryPoint
Commences an authentication scheme.

SecurityEnforcementFilter will populate the HttpSession attribute named AuthenticationProcessingFilter.ACEGI_SECURITY_TARGET_URL_KEY with the requested target URL before calling this method.

Implementations should modify the headers on the ServletResponse as necessary to commence the authentication process.

Specified by:
commence in interface AuthenticationEntryPoint
Parameters:
request - that resulted in an AuthenticationException
response - so that the user agent can begin authentication
authException - that caused the invocation
Throws:
IOException
javax.servlet.ServletException


Copyright © 2004-2005 Acegi Technology Pty Limited. All Rights Reserved.