com.raritantechnologies.jcifs
Class JCIFSLoginHandler

java.lang.Object
  extended bycom.raritantechnologies.jcifs.JCIFSLoginHandler
All Implemented Interfaces:
IConfigurable, ILoginHandler

public class JCIFSLoginHandler
extends java.lang.Object
implements ILoginHandler

Uses JCIFS package to implement NTLM authentication. Can be used with the LoginTag or LoginServlet to provide a silent login.

XML Configuration Template:
  <SystemObject type="LoginHandler" name="[ name of this handler ]"
                   configurableClass="com.raritantechnologies.jcifs.JCIFSLoginHandler"
                   basicRealm="[ name of Security realm for basic authentication ]"
                   ntlmDomain="[ name of NTLM domainController ]"
                   doAuthorization="[true(default)|false]" />
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Field Summary
static java.lang.String AUTHENTICATING
           
static java.lang.String NTLM_CACHE
           
static java.lang.String TYPE_1_MESSAGE
           
static java.lang.String TYPE_2_MESSAGE
           
static java.lang.String TYPE_3_MESSAGE
           
 
Constructor Summary
JCIFSLoginHandler()
           
 
Method Summary
 boolean authenticate(HttpServletRequest request, HttpServletResponse response)
          returns true if the User can be identified (authenticated) - usually because a valid login profile can be obtained.
 void destroy()
           
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
           
protected  HttpServletRequest getChainedRequest(HttpServletRequest origReq, NtlmPasswordAuthentication ntlm)
          Subclasses should override this if special treatment is needed.
 ILoginInfo getLoginInfo(HttpServletRequest request, HttpServletResponse response)
          returns a login profile (ILoginInfo) from the HTTP request.
 ILoginInfo getLoginInfo(ILoginInfo currentLogin, HttpServletRequest request, HttpServletResponse response)
          Checks to see if the current login credentials are valid for the NTLM domain.
 ILoginInfo getLoginInfo(RaritanPageContext pageContext)
          returns a login profile from a RaritanPageContext.
 void init(FilterConfig filterConfig)
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 boolean usesAuthenticationChallenge()
          returns true if the implementation sends an HTTP authentication request to the client (e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_1_MESSAGE

public static final java.lang.String TYPE_1_MESSAGE
See Also:
Constant Field Values

TYPE_2_MESSAGE

public static final java.lang.String TYPE_2_MESSAGE
See Also:
Constant Field Values

TYPE_3_MESSAGE

public static final java.lang.String TYPE_3_MESSAGE
See Also:
Constant Field Values

NTLM_CACHE

public static final java.lang.String NTLM_CACHE
See Also:
Constant Field Values

AUTHENTICATING

public static final java.lang.String AUTHENTICATING
See Also:
Constant Field Values
Constructor Detail

JCIFSLoginHandler

public JCIFSLoginHandler()
Method Detail

usesAuthenticationChallenge

public boolean usesAuthenticationChallenge()
Description copied from interface: ILoginHandler
returns true if the implementation sends an HTTP authentication request to the client (e.g. browser).

Specified by:
usesAuthenticationChallenge in interface ILoginHandler

authenticate

public boolean authenticate(HttpServletRequest request,
                            HttpServletResponse response)
Description copied from interface: ILoginHandler
returns true if the User can be identified (authenticated) - usually because a valid login profile can be obtained.

Specified by:
authenticate in interface ILoginHandler

getLoginInfo

public ILoginInfo getLoginInfo(ILoginInfo currentLogin,
                               HttpServletRequest request,
                               HttpServletResponse response)
Checks to see if the current login credentials are valid for the NTLM domain. If not, uses the default challenge (BASIC or NTLM authentication) to get a valid NTLM login from the user.


getLoginInfo

public ILoginInfo getLoginInfo(HttpServletRequest request,
                               HttpServletResponse response)
Description copied from interface: ILoginHandler
returns a login profile (ILoginInfo) from the HTTP request.

Specified by:
getLoginInfo in interface ILoginHandler

getLoginInfo

public ILoginInfo getLoginInfo(RaritanPageContext pageContext)
Description copied from interface: ILoginHandler
returns a login profile from a RaritanPageContext.

Specified by:
getLoginInfo in interface ILoginHandler

init

public void init(FilterConfig filterConfig)
          throws ServletException
Throws:
ServletException

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws java.io.IOException,
                     ServletException
Throws:
java.io.IOException
ServletException

getChainedRequest

protected HttpServletRequest getChainedRequest(HttpServletRequest origReq,
                                               NtlmPasswordAuthentication ntlm)
Subclasses should override this if special treatment is needed.


destroy

public void destroy()

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IConfigurable