Package org.apache.ofbiz.ldap.commons
Interface InterfaceOFBizAuthenticationHandler
- All Known Implementing Classes:
AbstractOFBizAuthenticationHandler
,OFBizActiveDirectoryAuthenticationHandler
,OFBizCasAuthenticationHandler
,OFBizLdapAuthenticationHandler
public interface InterfaceOFBizAuthenticationHandler
The OFBiz LDAP Authentication Handler interface.
-
Method Summary
Modifier and TypeMethodDescriptiongetLdapSearchResult
(String username, String password, Element rootElement, boolean bindRequired) Get LDAP search result from a username, password and configuration.getPartyId
(Element rootElement, SearchResult result) Get the party id of a user.getSecurityGroup
(Element rootElement, SearchResult result) Get the security group of a user.boolean
hasLdapLoggedOut
(HttpServletRequest request, HttpServletResponse response, Element rootElement) An HTTP WebEvent handler that checks to see is a userLogin is logged out in ldap.login
(HttpServletRequest request, HttpServletResponse response, Element rootElement) Login a user.logout
(HttpServletRequest request, HttpServletResponse response, Element rootElement) Logout a user.
-
Method Details
-
login
String login(HttpServletRequest request, HttpServletResponse response, Element rootElement) throws Exception Login a user.- Parameters:
request
- HttpServletRequestresponse
- HttpServletResponserootElement
- Element root element of ldap config file- Returns:
- success if the user can login successfully; otherwise, error.
- Throws:
Exception
-
getSecurityGroup
Get the security group of a user.- Parameters:
rootElement
- Element root element of ldap config fileresult
- SearchResult- Returns:
- the SecurityGroup object.
-
getPartyId
Get the party id of a user.- Parameters:
rootElement
- Element root element of ldap config fileresult
- SearchResult- Returns:
- the PartyId object.
-
logout
Logout a user.- Parameters:
request
- HttpServletRequestresponse
- HttpServletResponserootElement
- Element root element of ldap config file- Returns:
- success if the user can login successfully; otherwise, error.
-
getLdapSearchResult
SearchResult getLdapSearchResult(String username, String password, Element rootElement, boolean bindRequired) throws NamingException Get LDAP search result from a username, password and configuration.- 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
boolean hasLdapLoggedOut(HttpServletRequest request, HttpServletResponse response, Element rootElement) An HTTP WebEvent handler that checks to see is a userLogin is logged out in ldap. If yes, the user is forwarded to the login page. Currently, this function is only used in CAS authentication handler.- 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.
-