Package org.apache.ofbiz.ldap.cas
Class OFBizCasAuthenticationHandler
java.lang.Object
org.apache.ofbiz.ldap.commons.AbstractOFBizAuthenticationHandler
org.apache.ofbiz.ldap.cas.OFBizCasAuthenticationHandler
- All Implemented Interfaces:
InterfaceOFBizAuthenticationHandler
The OFBiz CAS-LDAP Authentication Handler.
The ACL of a user is still controlled by OFBiz.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPublic constructor, initializes some required member variables. -
Method Summary
Modifier and TypeMethodDescriptiongetLdapSearchResult
(String username, String password, Element rootElement, boolean bindRequired) Get LDAP search result from a username, password and configuration.boolean
hasLdapLoggedOut
(HttpServletRequest request, HttpServletResponse response, Element rootElement) An HTTP WebEvent handler that checks to see is a userLogin is logged out.login
(HttpServletRequest request, HttpServletResponse response, Element rootElement) Login a user.logout
(HttpServletRequest request, HttpServletResponse response, Element rootElement) Logout a user.static String
static String
randomString
(int lo, int hi) Methods inherited from class org.apache.ofbiz.ldap.commons.AbstractOFBizAuthenticationHandler
getPartyId, getSecurityGroup, login
-
Field Details
-
PARAM_TICKET
- See Also:
-
PARAM_SERVICE
- See Also:
-
PARAM_RENEW
- See Also:
-
-
Constructor Details
-
OFBizCasAuthenticationHandler
public OFBizCasAuthenticationHandler()Public constructor, initializes some required member variables.
-
-
Method Details
-
login
public String login(HttpServletRequest request, HttpServletResponse response, Element rootElement) throws Exception Description copied from interface:InterfaceOFBizAuthenticationHandler
Login a user.- Specified by:
login
in interfaceInterfaceOFBizAuthenticationHandler
- Overrides:
login
in classAbstractOFBizAuthenticationHandler
- Parameters:
request
- HttpServletRequestresponse
- HttpServletResponserootElement
- Element root element of ldap config file- Returns:
- success if the user can login successfully; otherwise, error.
- Throws:
Exception
-
randomString
-
randomString
-
logout
Description copied from interface:InterfaceOFBizAuthenticationHandler
Logout a user.- Specified by:
logout
in interfaceInterfaceOFBizAuthenticationHandler
- Overrides:
logout
in classAbstractOFBizAuthenticationHandler
- Parameters:
request
- HttpServletRequestresponse
- HttpServletResponserootElement
- Element root element of ldap config file- Returns:
- success if the user can login successfully; otherwise, error.
-
getLdapSearchResult
public SearchResult getLdapSearchResult(String username, String password, Element rootElement, boolean bindRequired) throws NamingException Description copied from interface:InterfaceOFBizAuthenticationHandler
Get LDAP search result from a username, password and configuration.- Specified by:
getLdapSearchResult
in interfaceInterfaceOFBizAuthenticationHandler
- Specified by:
getLdapSearchResult
in classAbstractOFBizAuthenticationHandler
- Parameters:
username
- Stringpassword
- StringrootElement
- Element root element of ldap config filebindRequired
- boolean if true, bind; false, just search the user in LDAP- Returns:
- result SearchResult if ldap search successfully; otherwise, null.
- Throws:
NamingException
-
hasLdapLoggedOut
public boolean hasLdapLoggedOut(HttpServletRequest request, HttpServletResponse response, 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 interfaceInterfaceOFBizAuthenticationHandler
- Overrides:
hasLdapLoggedOut
in classAbstractOFBizAuthenticationHandler
- 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.
-