| org.esupportail.cas.server.util.Server org.esupportail.cas.server.handlers.ldap.LdapServer
All known Subclasses: org.esupportail.cas.server.handlers.ldap.BindLdapServer, org.esupportail.cas.server.handlers.ldap.FastBindLdapServer,
LdapServer | abstract public class LdapServer extends Server (Code) | | This abstract class implements an LDAP server class, inherited by
BindLdapServer and FastBindLdapServer.
author: Pascal Aubry author: Jean-Baptiste Daniel |
Method Summary | |
final protected DirContext | connect(String bindDn, String bindPassword) Connect to the LDAP server using specified username and password.
Parameters: bindDn - the DN to use for the connection Parameters: bindPassword - the associated password a Connection object on success, null on error. | final protected boolean | connectAndClose(String bindDn, String bindPassword) Connect to the LDAP server using specified username and password
and immediatly close the connection. | final protected String | replaceTokens(String filter, String username) Take a filter (from CASGenericHandler configuration) and a
username, and replace tokens in the filter by their equivalents
in the username. |
LdapServer | public LdapServer(Boolean handlerDebug, RedundantHandler handler, Element serverElement) throws Exception(Code) | | Constructor.
Parameters: handlerDebug - debugging mode of the handler Parameters: handler - the handler the server will be used by Parameters: serverElement - the XML element that declares the server throws: Exception - Exception |
connect | final protected DirContext connect(String bindDn, String bindPassword)(Code) | | Connect to the LDAP server using specified username and password.
Parameters: bindDn - the DN to use for the connection Parameters: bindPassword - the associated password a Connection object on success, null on error. When the function returns false, the error code can be retrieved with the connectError() method. |
connectAndClose | final protected boolean connectAndClose(String bindDn, String bindPassword)(Code) | | Connect to the LDAP server using specified username and password
and immediatly close the connection. The error code can be retrieved
with the connectError() method.
Parameters: bindDn - the DN to use for the connection Parameters: bindPassword - the associated password true if the connection succeeded, false otherwise. |
replaceTokens | final protected String replaceTokens(String filter, String username)(Code) | | Take a filter (from CASGenericHandler configuration) and a
username, and replace tokens in the filter by their equivalents
in the username. The rules to replace tokens are the following ones:
- %%: %
- %u: user
- %U: user portion of %u (%U = test when %u = test@domain.tld)
- %d: domain portion of %u (%d = domain.tld when %u = test@domain.tld)
- %1-9: domain tokens (%1 = tld, %2 = domain when %d = domain.tld)
Parameters: username - a username (such as test@domain.com) Parameters: filter - a filter string containing tokens to be replaced a string corresponding to the input filter, where thepredefined tokens have been replaced by their equivalents. |
|
|