Java Doc for AbstractProcessingFilter.java in  » Security » acegi-security » org » acegisecurity » ui » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Security » acegi security » org.acegisecurity.ui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.acegisecurity.ui.AbstractProcessingFilter

All known Subclasses:   org.acegisecurity.ui.cas.CasProcessingFilter,  org.acegisecurity.ui.openid.OpenIdAuthenticationProcessingFilter,  org.acegisecurity.ui.openid.OpenIDResponseProcessingFilter,  org.acegisecurity.ui.webapp.AuthenticationProcessingFilter,
AbstractProcessingFilter
abstract public class AbstractProcessingFilter implements Filter,InitializingBean,ApplicationEventPublisherAware,MessageSourceAware(Code)
Abstract processor of browser-based HTTP-based authentication requests.

This filter is responsible for processing authentication requests. If authentication is successful, the resulting Authentication object will be placed into the SecurityContext, which is guaranteed to have already been created by an earlier filter.

If authentication fails, the AuthenticationException will be placed into the HttpSession with the attribute defined by AbstractProcessingFilter.ACEGI_SECURITY_LAST_EXCEPTION_KEY .

To use this filter, it is necessary to specify the following properties:

  • defaultTargetUrl indicates the URL that should be used for redirection if the HttpSession attribute named AbstractProcessingFilter.ACEGI_SAVED_REQUEST_KEY does not indicate the target URL once authentication is completed successfully. eg: /. The defaultTargetUrl will be treated as relative to the web-app's context path, and should include the leading /. Alternatively, inclusion of a scheme name (eg http:// or https://) as the prefix will denote a fully-qualified URL and this is also supported.
  • authenticationFailureUrl indicates the URL that should be used for redirection if the authentication request fails. eg: /login.jsp?login_error=1.
  • filterProcessesUrl indicates the URL that this filter will respond to. This parameter varies by subclass.
  • alwaysUseDefaultTargetUrl causes successful authentication to always redirect to the defaultTargetUrl, even if the HttpSession attribute named AbstractProcessingFilter.ACEGI_SAVED_REQUEST_KEY defines the intended target URL.

To configure this filter to redirect to specific pages as the result of specific AuthenticationException s you can do the following. Configure the exceptionMappings property in your application xml. This property is a java.util.Properties object that maps a fully-qualified exception class name to a redirection url target. For example:

 <property name="exceptionMappings">
 <props>
 <prop> key="org.acegisecurity.BadCredentialsException">/bad_credentials.jsp</prop>
 </props>
 </property>
 
The example above would redirect all org.acegisecurity.BadCredentialsException s thrown, to a page in the web-application called /bad_credentials.jsp.

Any AuthenticationException thrown that cannot be matched in the exceptionMappings will be redirected to the authenticationFailureUrl

If authentication is successful, an org.acegisecurity.event.authentication.InteractiveAuthenticationSuccessEvent will be published to the application context. No events will be published if authentication was unsuccessful, because this would generally be recorded via an AuthenticationManager-specific application event.


author:
   Ben Alex
version:
   $Id: AbstractProcessingFilter.java 1909 2007-06-19 04:08:19Z
version:
   vishalpuri $


Field Summary
final public static  StringACEGI_SAVED_REQUEST_KEY
    
final public static  StringACEGI_SECURITY_LAST_EXCEPTION_KEY
    
protected  AuthenticationDetailsSourceauthenticationDetailsSource
    
protected  ApplicationEventPublishereventPublisher
    
final protected  Loglogger
    
protected  MessageSourceAccessormessages
    


Method Summary
public  voidafterPropertiesSet()
    
abstract public  AuthenticationattemptAuthentication(HttpServletRequest request)
     Performs actual authentication.
public  voiddestroy()
     Does nothing.
protected  StringdetermineFailureUrl(HttpServletRequest request, AuthenticationException failed)
    
protected  StringdetermineTargetUrl(HttpServletRequest request)
    
public  voiddoFilter(ServletRequest request, ServletResponse response, FilterChain chain)
    
public  AuthenticationDetailsSourcegetAuthenticationDetailsSource()
    
public  StringgetAuthenticationFailureUrl()
    
public  AuthenticationManagergetAuthenticationManager()
    
abstract public  StringgetDefaultFilterProcessesUrl()
     Specifies the default filterProcessesUrl for the implementation.
public  StringgetDefaultTargetUrl()
     Supplies the default target Url that will be used if no saved request is found or the alwaysUseDefaultTargetUrl propert is set to true.
public  PropertiesgetExceptionMappings()
    
public  StringgetFilterProcessesUrl()
    
public  RememberMeServicesgetRememberMeServices()
    
public  voidinit(FilterConfig arg0)
     Does nothing.
public  booleanisAlwaysUseDefaultTargetUrl()
    
public  booleanisContinueChainBeforeSuccessfulAuthentication()
    
public static  StringobtainFullRequestUrl(HttpServletRequest request)
    
protected  voidonPreAuthentication(HttpServletRequest request, HttpServletResponse response)
    
protected  voidonSuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, Authentication authResult)
    
protected  voidonUnsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed)
    
protected  booleanrequiresAuthentication(HttpServletRequest request, HttpServletResponse response)
    

Indicates whether this filter should attempt to process a login request for the current invocation.

protected  voidsendRedirect(HttpServletRequest request, HttpServletResponse response, String url)
    
public  voidsetAlwaysUseDefaultTargetUrl(boolean alwaysUseDefaultTargetUrl)
    
public  voidsetApplicationEventPublisher(ApplicationEventPublisher eventPublisher)
    
public  voidsetAuthenticationDetailsSource(AuthenticationDetailsSource authenticationDetailsSource)
    
public  voidsetAuthenticationFailureUrl(String authenticationFailureUrl)
    
public  voidsetAuthenticationManager(AuthenticationManager authenticationManager)
    
public  voidsetBufferSize(int bufferSize)
    
public  voidsetContinueChainBeforeSuccessfulAuthentication(boolean continueChainBeforeSuccessfulAuthentication)
    
public  voidsetDefaultTargetUrl(String defaultTargetUrl)
    
public  voidsetExceptionMappings(Properties exceptionMappings)
    
public  voidsetFilterProcessesUrl(String filterProcessesUrl)
    
public  voidsetMessageSource(MessageSource messageSource)
    
public  voidsetRememberMeServices(RememberMeServices rememberMeServices)
    
public  voidsetUseRelativeContext(boolean useRelativeContext)
    
protected  voidsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, Authentication authResult)
    
protected  voidunsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed)
    

Field Detail
ACEGI_SAVED_REQUEST_KEY
final public static String ACEGI_SAVED_REQUEST_KEY(Code)



ACEGI_SECURITY_LAST_EXCEPTION_KEY
final public static String ACEGI_SECURITY_LAST_EXCEPTION_KEY(Code)



authenticationDetailsSource
protected AuthenticationDetailsSource authenticationDetailsSource(Code)



eventPublisher
protected ApplicationEventPublisher eventPublisher(Code)



logger
final protected Log logger(Code)



messages
protected MessageSourceAccessor messages(Code)





Method Detail
afterPropertiesSet
public void afterPropertiesSet() throws Exception(Code)



attemptAuthentication
abstract public Authentication attemptAuthentication(HttpServletRequest request) throws AuthenticationException(Code)
Performs actual authentication.
Parameters:
  request - from which to extract parameters and perform theauthentication the authenticated user
throws:
  AuthenticationException - if authentication fails



destroy
public void destroy()(Code)
Does nothing. We use IoC container lifecycle services instead.



determineFailureUrl
protected String determineFailureUrl(HttpServletRequest request, AuthenticationException failed)(Code)



determineTargetUrl
protected String determineTargetUrl(HttpServletRequest request)(Code)



doFilter
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException(Code)



getAuthenticationDetailsSource
public AuthenticationDetailsSource getAuthenticationDetailsSource()(Code)



getAuthenticationFailureUrl
public String getAuthenticationFailureUrl()(Code)



getAuthenticationManager
public AuthenticationManager getAuthenticationManager()(Code)



getDefaultFilterProcessesUrl
abstract public String getDefaultFilterProcessesUrl()(Code)
Specifies the default filterProcessesUrl for the implementation. the default filterProcessesUrl



getDefaultTargetUrl
public String getDefaultTargetUrl()(Code)
Supplies the default target Url that will be used if no saved request is found or the alwaysUseDefaultTargetUrl propert is set to true. Override this method of you want to provide a customized default Url (for example if you want different Urls depending on the authorities of the user who has just logged in). the defaultTargetUrl property



getExceptionMappings
public Properties getExceptionMappings()(Code)



getFilterProcessesUrl
public String getFilterProcessesUrl()(Code)



getRememberMeServices
public RememberMeServices getRememberMeServices()(Code)



init
public void init(FilterConfig arg0) throws ServletException(Code)
Does nothing. We use IoC container lifecycle services instead.
Parameters:
  arg0 - ignored
throws:
  ServletException - ignored



isAlwaysUseDefaultTargetUrl
public boolean isAlwaysUseDefaultTargetUrl()(Code)



isContinueChainBeforeSuccessfulAuthentication
public boolean isContinueChainBeforeSuccessfulAuthentication()(Code)



obtainFullRequestUrl
public static String obtainFullRequestUrl(HttpServletRequest request)(Code)



onPreAuthentication
protected void onPreAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException(Code)



onSuccessfulAuthentication
protected void onSuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, Authentication authResult) throws IOException(Code)



onUnsuccessfulAuthentication
protected void onUnsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException(Code)



requiresAuthentication
protected boolean requiresAuthentication(HttpServletRequest request, HttpServletResponse response)(Code)

Indicates whether this filter should attempt to process a login request for the current invocation.

It strips any parameters from the "path" section of the request URL (such as the jsessionid parameter in http://host/myapp/index.html;jsessionid=blah) before matching against the filterProcessesUrl property.

Subclasses may override for special requirements, such as Tapestry integration.


Parameters:
  request - as received from the filter chain
Parameters:
  response - as received from the filter chain true if the filter should attempt authentication,false otherwise



sendRedirect
protected void sendRedirect(HttpServletRequest request, HttpServletResponse response, String url) throws IOException(Code)



setAlwaysUseDefaultTargetUrl
public void setAlwaysUseDefaultTargetUrl(boolean alwaysUseDefaultTargetUrl)(Code)



setApplicationEventPublisher
public void setApplicationEventPublisher(ApplicationEventPublisher eventPublisher)(Code)



setAuthenticationDetailsSource
public void setAuthenticationDetailsSource(AuthenticationDetailsSource authenticationDetailsSource)(Code)



setAuthenticationFailureUrl
public void setAuthenticationFailureUrl(String authenticationFailureUrl)(Code)



setAuthenticationManager
public void setAuthenticationManager(AuthenticationManager authenticationManager)(Code)



setBufferSize
public void setBufferSize(int bufferSize)(Code)



setContinueChainBeforeSuccessfulAuthentication
public void setContinueChainBeforeSuccessfulAuthentication(boolean continueChainBeforeSuccessfulAuthentication)(Code)



setDefaultTargetUrl
public void setDefaultTargetUrl(String defaultTargetUrl)(Code)



setExceptionMappings
public void setExceptionMappings(Properties exceptionMappings)(Code)



setFilterProcessesUrl
public void setFilterProcessesUrl(String filterProcessesUrl)(Code)



setMessageSource
public void setMessageSource(MessageSource messageSource)(Code)



setRememberMeServices
public void setRememberMeServices(RememberMeServices rememberMeServices)(Code)



setUseRelativeContext
public void setUseRelativeContext(boolean useRelativeContext)(Code)



successfulAuthentication
protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, Authentication authResult) throws IOException(Code)



unsuccessfulAuthentication
protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.