public class BindRequestHandler extends LdapRequestHandler<org.apache.directory.api.ldap.model.message.BindRequest>
BindRequests.
Implements server-side of RFC 2222, sections 4.2 and 4.3.| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.String,MechanismHandler> |
handlers
A Hashed Adapter mapping SASL mechanisms to their handlers.
|
private static org.slf4j.Logger |
LOG |
ldapServer| Constructor and Description |
|---|
BindRequestHandler() |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
checkMechanism(java.lang.String saslMechanism)
Check if the mechanism exists.
|
private void |
generateSaslChallengeOrComplete(LdapSession ldapSession,
javax.security.sasl.SaslServer ss,
org.apache.directory.api.ldap.model.message.BindRequest bindRequest)
For challenge/response exchange, generate the challenge.
|
void |
handle(LdapSession ldapSession,
org.apache.directory.api.ldap.model.message.BindRequest bindRequest)
Deal with a received BindRequest
|
void |
handleSaslAuth(LdapSession ldapSession,
org.apache.directory.api.ldap.model.message.BindRequest bindRequest)
Handle the SASL authentication.
|
private void |
handleSaslAuthPending(LdapSession ldapSession,
org.apache.directory.api.ldap.model.message.BindRequest bindRequest) |
void |
handleSimpleAuth(LdapSession ldapSession,
org.apache.directory.api.ldap.model.message.BindRequest bindRequest)
Handle the Simple authentication.
|
private void |
sendAuthMethNotSupported(LdapSession ldapSession,
org.apache.directory.api.ldap.model.message.BindRequest bindRequest)
Send back an AUTH-METH-NOT-SUPPORTED error message to the client
|
private void |
sendBindSuccess(LdapSession ldapSession,
org.apache.directory.api.ldap.model.message.BindRequest bindRequest,
byte[] tokenBytes)
Send a SUCCESS message back to the client.
|
private void |
sendInvalidCredentials(LdapSession ldapSession,
org.apache.directory.api.ldap.model.message.BindRequest bindRequest,
java.lang.Exception e)
Send back an INVALID-CREDENTIAL error message to the user.
|
void |
setSaslMechanismHandlers(java.util.Map<java.lang.String,MechanismHandler> handlers)
Set the mechanisms handler map.
|
getLdapServer, handleException, handleMessage, isConfidentialityRequirementSatisfied, rejectWithoutConfidentiality, setLdapServerprivate static final org.slf4j.Logger LOG
private java.util.Map<java.lang.String,MechanismHandler> handlers
public void setSaslMechanismHandlers(java.util.Map<java.lang.String,MechanismHandler> handlers)
handlers - The associations btween a machanism and its handlerpublic void handleSimpleAuth(LdapSession ldapSession, org.apache.directory.api.ldap.model.message.BindRequest bindRequest) throws java.lang.Exception
ldapSession - The associated SessionbindRequest - The BindRequest receivedjava.lang.Exception - If the authentication cannot be doneprivate boolean checkMechanism(java.lang.String saslMechanism)
throws java.lang.Exception
java.lang.Exceptionprivate void generateSaslChallengeOrComplete(LdapSession ldapSession, javax.security.sasl.SaslServer ss, org.apache.directory.api.ldap.model.message.BindRequest bindRequest) throws java.lang.Exception
ldapSession - ss - bindRequest - java.lang.Exceptionprivate void sendAuthMethNotSupported(LdapSession ldapSession, org.apache.directory.api.ldap.model.message.BindRequest bindRequest)
private void sendInvalidCredentials(LdapSession ldapSession, org.apache.directory.api.ldap.model.message.BindRequest bindRequest, java.lang.Exception e)
private void sendBindSuccess(LdapSession ldapSession, org.apache.directory.api.ldap.model.message.BindRequest bindRequest, byte[] tokenBytes)
private void handleSaslAuthPending(LdapSession ldapSession, org.apache.directory.api.ldap.model.message.BindRequest bindRequest) throws java.lang.Exception
java.lang.Exceptionpublic void handleSaslAuth(LdapSession ldapSession, org.apache.directory.api.ldap.model.message.BindRequest bindRequest) throws java.lang.Exception
ldapSession - The associated SessionbindRequest - The BindRequest receivedjava.lang.Exception - If the authentication cannot be donepublic void handle(LdapSession ldapSession, org.apache.directory.api.ldap.model.message.BindRequest bindRequest) throws java.lang.Exception
handle in class LdapRequestHandler<org.apache.directory.api.ldap.model.message.BindRequest>ldapSession - The current sessionbindRequest - The received BindRequestjava.lang.Exception - If the authentication cannot be handled