org.exoplatform.services.security.sso.spnego
Class SpnegoFilter

java.lang.Object
  extended by org.exoplatform.services.security.sso.spnego.SpnegoFilter
All Implemented Interfaces:
javax.servlet.Filter

Deprecated. In eXo implementation SSOAuthenticationFilter must be used instead this.

public class SpnegoFilter
extends Object
implements javax.servlet.Filter

Filter that stores a ServletSpnegoHandler in session attribute com.taglab.support.spnego.SpnegoFilter. It then invokes ServletSpnegoHandler.authenticate(HttpServletRequest, HttpServletResponse) to perform any necessary authorization. If the authorization is successful, the chain is processed. If the authorization fails, a 403 Forbidden reponse code is sent.

The filter does by default catch exceptions to not display stack traces in the browser. Wether or not to catch them can be controlled by the init parameter catchExceptions. If an exception is caught, a 500 response is sent to the client and the stack trace dumped to stdout. setCatchExceptions(boolean).

Upon successfully established context, the filter can instead of letting the request through the chain, optionally redirect to another url. This is set with init parameter redirectOnEstablished. The path is webapp relative. setRedirectOnEstablished(String).

If the context is fails, the filter can instead of doing a 403 Forbidden redirect to another url. This is set with init parameter redirectOnFailed. The path is webapp relative. setRedirectOnFailed(String).

Author:
Martin Algesten

Field Summary
static String HANDLER_ATTRIBUTE_KEY
          Deprecated. The name of the session attribute we bind the handler to.
 
Constructor Summary
SpnegoFilter()
          Deprecated.  
 
Method Summary
static ServletSpnegoHandler bindNewServletSpnegoHandlerInSession(javax.servlet.http.HttpServletRequest request)
          Deprecated. Utility method for setting a new ServletSpnegoHandler in the session.
 void destroy()
          Deprecated. 
 void doFilter(javax.servlet.ServletRequest inrequest, javax.servlet.ServletResponse inresponse, javax.servlet.FilterChain chain)
          Deprecated. 
static ServletSpnegoHandler extractServletSpnegoHandlerFromSession(javax.servlet.http.HttpServletRequest request)
          Deprecated. Utility method for obtaining the ServletSpnegoHandler bound to the session.
 void init(javax.servlet.FilterConfig config)
          Deprecated. 
 void setCatchExceptions(boolean catchExceptions)
          Deprecated.  
 void setRedirectOnEstablished(String redirectOnEstablished)
          Deprecated.  
 void setRedirectOnFailed(String redirectOnFailed)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HANDLER_ATTRIBUTE_KEY

public static final String HANDLER_ATTRIBUTE_KEY
Deprecated. 
The name of the session attribute we bind the handler to. "spnego.ServletSpnegoHandler".

See Also:
Constant Field Values
Constructor Detail

SpnegoFilter

public SpnegoFilter()
Deprecated. 
Method Detail

destroy

public void destroy()
Deprecated. 

Specified by:
destroy in interface javax.servlet.Filter

doFilter

public void doFilter(javax.servlet.ServletRequest inrequest,
                     javax.servlet.ServletResponse inresponse,
                     javax.servlet.FilterChain chain)
              throws IOException,
                     javax.servlet.ServletException
Deprecated. 

Specified by:
doFilter in interface javax.servlet.Filter
Throws:
IOException
javax.servlet.ServletException

extractServletSpnegoHandlerFromSession

public static ServletSpnegoHandler extractServletSpnegoHandlerFromSession(javax.servlet.http.HttpServletRequest request)
Deprecated. 
Utility method for obtaining the ServletSpnegoHandler bound to the session.

Parameters:
request - HttpServletRequest.
Returns:
ServletSpnegoHandler.

bindNewServletSpnegoHandlerInSession

public static ServletSpnegoHandler bindNewServletSpnegoHandlerInSession(javax.servlet.http.HttpServletRequest request)
Deprecated. 
Utility method for setting a new ServletSpnegoHandler in the session.

Parameters:
request - HttpServletRequest.
Returns:
ServletSpnegoHandler.

init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
Deprecated. 

Specified by:
init in interface javax.servlet.Filter
Throws:
javax.servlet.ServletException

setCatchExceptions

public void setCatchExceptions(boolean catchExceptions)
Deprecated. 
Parameters:
catchExceptions - the catchExceptions to set

setRedirectOnEstablished

public void setRedirectOnEstablished(String redirectOnEstablished)
Deprecated. 
Parameters:
redirectOnEstablished - the redirectOnEstablished to set

setRedirectOnFailed

public void setRedirectOnFailed(String redirectOnFailed)
Deprecated. 
Parameters:
redirectOnFailed - the redirectOnFailed to set


Copyright © 2009 eXo Platform SAS. All Rights Reserved.