Class OFBizCasAuthenticationHandler

    • Constructor Summary

      Constructors 
      Constructor Description
      OFBizCasAuthenticationHandler()
      Public constructor, initializes some required member variables.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.naming.directory.SearchResult getLdapSearchResult​(java.lang.String username, java.lang.String password, org.w3c.dom.Element rootElement, boolean bindRequired)
      Get LDAP search result from a username, password and configuration.
      boolean hasLdapLoggedOut​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.w3c.dom.Element rootElement)
      An HTTP WebEvent handler that checks to see is a userLogin is logged out.
      java.lang.String login​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.w3c.dom.Element rootElement)
      Login a user.
      java.lang.String logout​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.w3c.dom.Element rootElement)
      Logout a user.
      static java.lang.String randomString()  
      static java.lang.String randomString​(int lo, int hi)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OFBizCasAuthenticationHandler

        public OFBizCasAuthenticationHandler()
        Public constructor, initializes some required member variables.

    • Method Detail

      • login

        public java.lang.String login​(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response,
                                      org.w3c.dom.Element rootElement)
                               throws java.lang.Exception
        Description copied from interface: InterfaceOFBizAuthenticationHandler
        Login a user.
        Specified by:
        login in interface InterfaceOFBizAuthenticationHandler
        Overrides:
        login in class AbstractOFBizAuthenticationHandler
        Parameters:
        request - HttpServletRequest
        response - HttpServletResponse
        rootElement - Element root element of ldap config file
        Returns:
        success if the user can login successfully; otherwise, error.
        Throws:
        java.lang.Exception
      • randomString

        public static java.lang.String randomString​(int lo,
                                                    int hi)
      • randomString

        public static java.lang.String randomString()
      • logout

        public java.lang.String logout​(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response,
                                       org.w3c.dom.Element rootElement)
        Description copied from interface: InterfaceOFBizAuthenticationHandler
        Logout a user.
        Specified by:
        logout in interface InterfaceOFBizAuthenticationHandler
        Overrides:
        logout in class AbstractOFBizAuthenticationHandler
        Parameters:
        request - HttpServletRequest
        response - HttpServletResponse
        rootElement - Element root element of ldap config file
        Returns:
        success if the user can login successfully; otherwise, error.
      • getLdapSearchResult

        public javax.naming.directory.SearchResult getLdapSearchResult​(java.lang.String username,
                                                                       java.lang.String password,
                                                                       org.w3c.dom.Element rootElement,
                                                                       boolean bindRequired)
                                                                throws javax.naming.NamingException
        Description copied from interface: InterfaceOFBizAuthenticationHandler
        Get LDAP search result from a username, password and configuration.
        Specified by:
        getLdapSearchResult in interface InterfaceOFBizAuthenticationHandler
        Specified by:
        getLdapSearchResult in class AbstractOFBizAuthenticationHandler
        Parameters:
        username - String
        password - String
        rootElement - Element root element of ldap config file
        bindRequired - boolean if true, bind; false, just search the user in LDAP
        Returns:
        result SearchResult if ldap search successfully; otherwise, null.
        Throws:
        javax.naming.NamingException
      • hasLdapLoggedOut

        public boolean hasLdapLoggedOut​(javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response,
                                        org.w3c.dom.Element rootElement)
        An HTTP WebEvent handler that checks to see is a userLogin is logged out. If yes, the user is forwarded to the login page.
        Specified by:
        hasLdapLoggedOut in interface InterfaceOFBizAuthenticationHandler
        Overrides:
        hasLdapLoggedOut in class AbstractOFBizAuthenticationHandler
        Parameters:
        request - The HTTP request object for the current JSP or Servlet request.
        response - The HTTP response object for the current JSP or Servlet request.
        rootElement - Element root element of ldap config file
        Returns:
        true if the user has logged out from ldap; otherwise, false.