Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.ui.web.auth
Class NuxeoAuthenticationFilter

java.lang.Object
  extended by org.nuxeo.ecm.platform.ui.web.auth.NuxeoAuthenticationFilter
All Implemented Interfaces:
Filter
Direct Known Subclasses:
NuxeoLauncher

public class NuxeoAuthenticationFilter
extends Object
implements Filter

Servlet filter handling Nuxeo authentication (JAAS + EJB).

Also handles logout and identity switch.

Author:
Thierry Delprat, Bogdan Stefanescu, Anahide Tchertchian, Florent Guillaume

Field Summary
static String DEFAULT_START_PAGE
           
static String IS_LOGIN_NOT_SYNCHRONIZED_PROPERTY_KEY
           
static String LOGIN_DOMAIN
          LoginContext domain name in use by default in Nuxeo.
 
Constructor Summary
NuxeoAuthenticationFilter()
           
 
Method Summary
 void destroy()
           
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
           
 void doFilterInternal(ServletRequest request, ServletResponse response, FilterChain chain)
           
 NuxeoAuthenticationPlugin getAuthenticator(CachableUserIdentificationInfo ci)
           
static String getRequestedPage(ServletRequest request)
           
static String getRequestedUrl(HttpServletRequest httpRequest)
           
 void init(FilterConfig config)
           
static LoginContext loginAs(String username)
          Does a forced login as the given user.
 boolean saveRequestedURLBeforeRedirect(HttpServletRequest httpRequest, HttpServletResponse httpResponse)
          Save requested URL before redirecting to login form.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_START_PAGE

public static final String DEFAULT_START_PAGE
See Also:
Constant Field Values

LOGIN_DOMAIN

public static final String LOGIN_DOMAIN
LoginContext domain name in use by default in Nuxeo.

See Also:
Constant Field Values

IS_LOGIN_NOT_SYNCHRONIZED_PROPERTY_KEY

public static final String IS_LOGIN_NOT_SYNCHRONIZED_PROPERTY_KEY
See Also:
Constant Field Values
Constructor Detail

NuxeoAuthenticationFilter

public NuxeoAuthenticationFilter()
Method Detail

destroy

public void destroy()
Specified by:
destroy in interface Filter

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws IOException,
                     ServletException
Specified by:
doFilter in interface Filter
Throws:
IOException
ServletException

doFilterInternal

public void doFilterInternal(ServletRequest request,
                             ServletResponse response,
                             FilterChain chain)
                      throws IOException,
                             ServletException
Throws:
IOException
ServletException

getAuthenticator

public NuxeoAuthenticationPlugin getAuthenticator(CachableUserIdentificationInfo ci)

init

public void init(FilterConfig config)
          throws ServletException
Specified by:
init in interface Filter
Throws:
ServletException

saveRequestedURLBeforeRedirect

public boolean saveRequestedURLBeforeRedirect(HttpServletRequest httpRequest,
                                              HttpServletResponse httpResponse)
Save requested URL before redirecting to login form.

Returns true if target url is a valid startup page.


getRequestedUrl

public static String getRequestedUrl(HttpServletRequest httpRequest)

getRequestedPage

public static String getRequestedPage(ServletRequest request)

loginAs

public static LoginContext loginAs(String username)
                            throws LoginException
Does a forced login as the given user. Bypasses all authentication checks.

Parameters:
username - the user name
Returns:
the login context, which MUST be used for logout in a finally block
Throws:
LoginException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.