| 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 ActionRequest s
and RenderRequest s 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 void | afterActionCompletion(ActionRequest request, ActionResponse response, Object handler, Exception ex) | public void | afterPropertiesSet() | public void | afterRenderCompletion(RenderRequest request, RenderResponse response, Object handler, Exception ex) | public AuthenticationManager | getAuthenticationManager() | protected Object | getCredentialsFromRequest(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 Object | getPrincipalFromRequest(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 List | getUserNameAttributes() | protected void | onPreAuthentication(PortletRequest request, PortletResponse response) Callback for custom processing prior to the authentication attempt. | protected void | onSuccessfulAuthentication(PortletRequest request, PortletResponse response, Authentication authResult) Callback for custom processing after a successful authentication attempt. | protected void | onUnsuccessfulAuthentication(PortletRequest request, PortletResponse response, AuthenticationException failed) Callback for custom processing after an unsuccessful authentication attempt. | public void | postHandleRender(RenderRequest request, RenderResponse response, Object handler, ModelAndView modelAndView) | public boolean | preHandleAction(ActionRequest request, ActionResponse response, Object handler) | public boolean | preHandleRender(RenderRequest request, RenderResponse response, Object handler) | public void | setAuthenticationManager(AuthenticationManager authenticationManager) | public void | setUserNameAttributes(List userNameAttributes) |
afterActionCompletion | public void afterActionCompletion(ActionRequest request, ActionResponse response, Object handler, Exception ex) throws Exception(Code) | | |
afterRenderCompletion | public void afterRenderCompletion(RenderRequest request, RenderResponse response, Object handler, Exception ex) throws Exception(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) | | |
setUserNameAttributes | public void setUserNameAttributes(List userNameAttributes)(Code) | | |
|
|