org.acegisecurity.ui.basicauth
Class BasicProcessingFilterEntryPoint

java.lang.Object
  extended by org.acegisecurity.ui.basicauth.BasicProcessingFilterEntryPoint
All Implemented Interfaces:
AuthenticationEntryPoint, InitializingBean, ApplicationContextAware, Ordered

public class BasicProcessingFilterEntryPoint
extends Object
implements AuthenticationEntryPoint, InitializingBean, Ordered, ApplicationContextAware

Used by the SecurityEnforcementFilter to commence authentication via the BasicProcessingFilter.

Once a user agent is authenticated using BASIC authentication, logout requires that the browser be closed or an unauthorized (401) header be sent. The simplest way of achieving the latter is to call the commence(ServletRequest, ServletResponse, AuthenticationException) method below. This will indicate to the browser its credentials are no longer authorized, causing it to prompt the user to login again.

Version:
$Id: BasicProcessingFilterEntryPoint.java 1877 2007-05-25 05:33:06Z benalex $
Author:
Ben Alex

Field Summary
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
BasicProcessingFilterEntryPoint()
           
 
Method Summary
 void afterPropertiesSet()
           
 void commence(ServletRequest request, ServletResponse response, AuthenticationException authException)
          Commences an authentication scheme.
 int getOrder()
           
 String getRealmName()
           
 void setApplicationContext(ApplicationContext applicationContext)
           
 void setOrder(int order)
           
 void setRealmName(String realmName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicProcessingFilterEntryPoint

public BasicProcessingFilterEntryPoint()
Method Detail

getOrder

public int getOrder()
Specified by:
getOrder in interface Ordered

setOrder

public void setOrder(int order)

afterPropertiesSet

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

commence

public void commence(ServletRequest request,
                     ServletResponse response,
                     AuthenticationException authException)
              throws IOException,
                     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 - DOCUMENT ME!
ServletException - DOCUMENT ME!

getRealmName

public String getRealmName()

setRealmName

public void setRealmName(String realmName)

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
Specified by:
setApplicationContext in interface ApplicationContextAware


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