Java Doc for PortletProcessingInterceptor.java in  » Security » acegi-security » org » acegisecurity » ui » portlet » 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.portlet 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.acegisecurity.ui.portlet.PortletProcessingInterceptor

PortletProcessingInterceptor
public class PortletProcessingInterceptor implements HandlerInterceptor,InitializingBean(Code)

This interceptor is responsible for processing portlet authentication requests. This is the portlet equivalent of the AuthenticationProcessingFilter used for traditional servlet-based web applications. It is applied to both ActionRequests and RenderRequests alike. 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 interceptor. If authentication fails, the AuthenticationException will be placed into the PortletSession with the attribute defined by AbstractProcessingFilter.ACEGI_SECURITY_LAST_EXCEPTION_KEY .

Some portals do not properly provide the identity of the current user via the getRemoteUser() or getUserPrincipal() methods of the PortletRequest. In these cases they sometimes make it available in the USER_INFO map provided as one of the attributes of the request. If this is the case in your portal, you can specify a list of USER_INFO attributes to check for the username via the userNameAttributes property of this bean. You can also completely override the PortletProcessingInterceptor.getPrincipalFromRequest(PortletRequest) and PortletProcessingInterceptor.getCredentialsFromRequest(PortletRequest) methods to suit the particular behavior of your portal.

This interceptor will put the PortletRequest object into the details property of the Authentication object that is sent as a request to the AuthenticationManager. This is done so that the request is available to classes like ContainerPortletAuthoritiesPopulator that need access to information from the portlet container. The PortletAuthenticationProvider will replace this with the USER_INFO map in the resulting Authentication object.


See Also:   org.acegisecurity.ui.AbstractProcessingFilter
See Also:   org.acegisecurity.ui.webapp.AuthenticationProcessingFilter
author:
   John A. Lewis
since:
   2.0
version:
   $Id$




Method Summary
public  voidafterActionCompletion(ActionRequest request, ActionResponse response, Object handler, Exception ex)
    
public  voidafterPropertiesSet()
    
public  voidafterRenderCompletion(RenderRequest request, RenderResponse response, Object handler, Exception ex)
    
public  AuthenticationManagergetAuthenticationManager()
    
protected  ObjectgetCredentialsFromRequest(PortletRequest request)
     This method attempts to extract a credentials from the portlet request. We are trusting the portal framework to authenticate the user, so all we are really doing is trying to put something intelligent in here to indicate the user is authenticated.
protected  ObjectgetPrincipalFromRequest(PortletRequest request)
     This method attempts to extract a principal from the portlet request. According to the JSR-168 spec, the PortletRequest should return the name of the user in the getRemoteUser() method.
public  ListgetUserNameAttributes()
    
protected  voidonPreAuthentication(PortletRequest request, PortletResponse response)
     Callback for custom processing prior to the authentication attempt.
protected  voidonSuccessfulAuthentication(PortletRequest request, PortletResponse response, Authentication authResult)
     Callback for custom processing after a successful authentication attempt.
protected  voidonUnsuccessfulAuthentication(PortletRequest request, PortletResponse response, AuthenticationException failed)
     Callback for custom processing after an unsuccessful authentication attempt.
public  voidpostHandleRender(RenderRequest request, RenderResponse response, Object handler, ModelAndView modelAndView)
    
public  booleanpreHandleAction(ActionRequest request, ActionResponse response, Object handler)
    
public  booleanpreHandleRender(RenderRequest request, RenderResponse response, Object handler)
    
public  voidsetAuthenticationManager(AuthenticationManager authenticationManager)
    
public  voidsetUserNameAttributes(List userNameAttributes)
    



Method Detail
afterActionCompletion
public void afterActionCompletion(ActionRequest request, ActionResponse response, Object handler, Exception ex) throws Exception(Code)



afterPropertiesSet
public void afterPropertiesSet() throws Exception(Code)



afterRenderCompletion
public void afterRenderCompletion(RenderRequest request, RenderResponse response, Object handler, Exception ex) throws Exception(Code)



getAuthenticationManager
public AuthenticationManager getAuthenticationManager()(Code)



getCredentialsFromRequest
protected Object getCredentialsFromRequest(PortletRequest request)(Code)
This method attempts to extract a credentials from the portlet request. We are trusting the portal framework to authenticate the user, so all we are really doing is trying to put something intelligent in here to indicate the user is authenticated. According to the JSR-168 spec, PortletRequest.getAuthType() should return a non-null value if the user is authenticated and should be null if not authenticated. So we will use this as the credentials and the token will be trusted as authenticated if the credentials are not null.

This method can be overridden by subclasses to provide special handling for portals with weak support for the JSR-168 spec. If that is done, be sure the value is non-null for authenticated users and null for non-authenticated users.


Parameters:
  request - the portlet request object the determined credentials object, or null if none found



getPrincipalFromRequest
protected Object getPrincipalFromRequest(PortletRequest request)(Code)
This method attempts to extract a principal from the portlet request. According to the JSR-168 spec, the PortletRequest should return the name of the user in the getRemoteUser() method. It should also provide a java.security.Principal object from the getUserPrincipal() method. We will first try these to come up with a valid username.

Unfortunately, some portals do not properly return these values for authenticated users. So, if neither of those succeeds and if the userNameAttributes property has been populated, then we will search through the USER_INFO map from the request to see if we can find a valid username.

This method can be overridden by subclasses to provide special handling for portals with weak support for the JSR-168 spec.


Parameters:
  request - the portlet request object the determined principal object, or null if none found



getUserNameAttributes
public List getUserNameAttributes()(Code)



onPreAuthentication
protected void onPreAuthentication(PortletRequest request, PortletResponse response) throws AuthenticationException, IOException(Code)
Callback for custom processing prior to the authentication attempt.
Parameters:
  request - the portlet request to be authenticated
Parameters:
  response - the portlet response to be authenticated
throws:
  AuthenticationException - to indicate that authentication attempt is not valid and should be terminated
throws:
  IOException -



onSuccessfulAuthentication
protected void onSuccessfulAuthentication(PortletRequest request, PortletResponse response, Authentication authResult) throws IOException(Code)
Callback for custom processing after a successful authentication attempt.
Parameters:
  request - the portlet request that was authenticated
Parameters:
  response - the portlet response that was authenticated
Parameters:
  authResult - the resulting Authentication object
throws:
  IOException -



onUnsuccessfulAuthentication
protected void onUnsuccessfulAuthentication(PortletRequest request, PortletResponse response, AuthenticationException failed) throws IOException(Code)
Callback for custom processing after an unsuccessful authentication attempt.
Parameters:
  request - the portlet request that failed authentication
Parameters:
  response - the portlet response that failed authentication
Parameters:
  failed - the AuthenticationException that occurred
throws:
  IOException -



postHandleRender
public void postHandleRender(RenderRequest request, RenderResponse response, Object handler, ModelAndView modelAndView) throws Exception(Code)



preHandleAction
public boolean preHandleAction(ActionRequest request, ActionResponse response, Object handler) throws Exception(Code)



preHandleRender
public boolean preHandleRender(RenderRequest request, RenderResponse response, Object handler) throws Exception(Code)



setAuthenticationManager
public void setAuthenticationManager(AuthenticationManager authenticationManager)(Code)



setUserNameAttributes
public void setUserNameAttributes(List userNameAttributes)(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.