@NotMutable @ThreadSafety(level=NOT_THREADSAFE) public final class DIGESTMD5BindRequest extends SASLBindRequest implements javax.security.auth.callback.CallbackHandler
DIGESTMD5BindRequest bindRequest = new DIGESTMD5BindRequest("u:john.doe", "password"); BindResult bindResult; try { bindResult = connection.bind(bindRequest); // If we get here, then the bind was successful. } catch (LDAPException le) { // The bind failed for some reason. bindResult = new BindResult(le.toLDAPResult()); ResultCode resultCode = le.getResultCode(); String errorMessageFromServer = le.getDiagnosticMessage(); }
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DIGESTMD5_MECHANISM_NAME
The name for the DIGEST-MD5 SASL mechanism.
|
CRED_TYPE_SASL
VERSION_ELEMENT
Constructor and Description |
---|
DIGESTMD5BindRequest(DIGESTMD5BindRequestProperties properties,
Control... controls)
Creates a new SASL DIGEST-MD5 bind request with the provided set of
properties.
|
DIGESTMD5BindRequest(java.lang.String authenticationID,
ASN1OctetString password)
Creates a new SASL DIGEST-MD5 bind request with the provided authentication
ID and password.
|
DIGESTMD5BindRequest(java.lang.String authenticationID,
byte[] password)
Creates a new SASL DIGEST-MD5 bind request with the provided authentication
ID and password.
|
DIGESTMD5BindRequest(java.lang.String authenticationID,
java.lang.String password)
Creates a new SASL DIGEST-MD5 bind request with the provided authentication
ID and password.
|
DIGESTMD5BindRequest(java.lang.String authenticationID,
java.lang.String authorizationID,
ASN1OctetString password,
java.lang.String realm,
Control... controls)
Creates a new SASL DIGEST-MD5 bind request with the provided information.
|
DIGESTMD5BindRequest(java.lang.String authenticationID,
java.lang.String authorizationID,
byte[] password,
java.lang.String realm,
Control... controls)
Creates a new SASL DIGEST-MD5 bind request with the provided information.
|
DIGESTMD5BindRequest(java.lang.String authenticationID,
java.lang.String authorizationID,
java.lang.String password,
java.lang.String realm,
Control... controls)
Creates a new SASL DIGEST-MD5 bind request with the provided information.
|
Modifier and Type | Method and Description |
---|---|
DIGESTMD5BindRequest |
duplicate()
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
DIGESTMD5BindRequest |
duplicate(Control[] controls)
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
java.util.List<SASLQualityOfProtection> |
getAllowedQoP()
Retrieves the list of allowed qualities of protection that may be used for
communication that occurs on the connection after the authentication has
completed, in order from most preferred to least preferred.
|
java.lang.String |
getAuthenticationID()
Retrieves the authentication ID for this bind request.
|
java.lang.String |
getAuthorizationID()
Retrieves the authorization ID for this bind request, if any.
|
int |
getLastMessageID()
Retrieves the message ID for the last LDAP message sent using this request.
|
byte[] |
getPasswordBytes()
Retrieves the bytes that comprise the the password for this bind request.
|
java.lang.String |
getPasswordString()
Retrieves the string representation of the password for this bind request.
|
java.lang.String |
getRealm()
Retrieves the realm for this bind request, if any.
|
DIGESTMD5BindRequest |
getRebindRequest(java.lang.String host,
int port)
Retrieves a bind request that may be used to re-bind using the same
credentials authentication type and credentials as previously used to
perform the initial bind.
|
java.lang.String |
getSASLMechanismName()
Retrieves the name of the SASL mechanism used in this SASL bind request.
|
void |
handle(javax.security.auth.callback.Callback[] callbacks)
Handles any necessary callbacks required for SASL authentication.
|
protected BindResult |
process(LDAPConnection connection,
int depth)
Sends this bind request to the target server over the provided connection
and returns the corresponding response.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this request to the provided buffer.
|
getBindType, responseReceived, sendBindRequest, sendMessage
getOperationType
followReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getResponseTimeoutMillis, hasControl, hasControl, setFollowReferrals, setIntermediateResponseListener, setResponseTimeoutMillis, toString
public static final java.lang.String DIGESTMD5_MECHANISM_NAME
public DIGESTMD5BindRequest(java.lang.String authenticationID, java.lang.String password)
authenticationID
- The authentication ID for this bind request. It
must not be null
.password
- The password for this bind request. It must not
be null
.public DIGESTMD5BindRequest(java.lang.String authenticationID, byte[] password)
authenticationID
- The authentication ID for this bind request. It
must not be null
.password
- The password for this bind request. It must not
be null
.public DIGESTMD5BindRequest(java.lang.String authenticationID, ASN1OctetString password)
authenticationID
- The authentication ID for this bind request. It
must not be null
.password
- The password for this bind request. It must not
be null
.public DIGESTMD5BindRequest(java.lang.String authenticationID, java.lang.String authorizationID, java.lang.String password, java.lang.String realm, Control... controls)
authenticationID
- The authentication ID for this bind request. It
must not be null
.authorizationID
- The authorization ID for this bind request. It
may be null
if there will not be an
alternate authorization identity.password
- The password for this bind request. It must not
be null
.realm
- The realm to use for the authentication. It may
be null
if the server supports a default
realm.controls
- The set of controls to include in the request.public DIGESTMD5BindRequest(java.lang.String authenticationID, java.lang.String authorizationID, byte[] password, java.lang.String realm, Control... controls)
authenticationID
- The authentication ID for this bind request. It
must not be null
.authorizationID
- The authorization ID for this bind request. It
may be null
if there will not be an
alternate authorization identity.password
- The password for this bind request. It must not
be null
.realm
- The realm to use for the authentication. It may
be null
if the server supports a default
realm.controls
- The set of controls to include in the request.public DIGESTMD5BindRequest(java.lang.String authenticationID, java.lang.String authorizationID, ASN1OctetString password, java.lang.String realm, Control... controls)
authenticationID
- The authentication ID for this bind request. It
must not be null
.authorizationID
- The authorization ID for this bind request. It
may be null
if there will not be an
alternate authorization identity.password
- The password for this bind request. It must not
be null
.realm
- The realm to use for the authentication. It may
be null
if the server supports a default
realm.controls
- The set of controls to include in the request.public DIGESTMD5BindRequest(DIGESTMD5BindRequestProperties properties, Control... controls)
properties
- The properties to use for thiscontrols
- The set of controls to include in the request.public java.lang.String getSASLMechanismName()
getSASLMechanismName
in class SASLBindRequest
public java.lang.String getAuthenticationID()
public java.lang.String getAuthorizationID()
null
if
there should not be a separate authorization identity.public java.lang.String getPasswordString()
public byte[] getPasswordBytes()
public java.lang.String getRealm()
null
if none was
defined and the server should use the default realm.public java.util.List<SASLQualityOfProtection> getAllowedQoP()
protected BindResult process(LDAPConnection connection, int depth) throws LDAPException
process
in class BindRequest
connection
- The connection to use to send this bind request to the
server and read the associated response.depth
- The current referral depth for this request. It should
always be one for the initial request, and should only
be incremented when following referrals.LDAPException
- If a problem occurs while sending the request or
reading the response.public DIGESTMD5BindRequest getRebindRequest(java.lang.String host, int port)
getRebindRequest
in class BindRequest
host
- The address of the directory server to which the connection
is established.port
- The port of the directory server to which the connection is
established.null
to indicate that automatic
re-binding is not supported for this type of bind request.@InternalUseOnly public void handle(javax.security.auth.callback.Callback[] callbacks)
handle
in interface javax.security.auth.callback.CallbackHandler
callbacks
- The set of callbacks to be handled.public int getLastMessageID()
getLastMessageID
in class SASLBindRequest
public DIGESTMD5BindRequest duplicate()
duplicate
in interface ReadOnlyLDAPRequest
duplicate
in class BindRequest
public DIGESTMD5BindRequest duplicate(Control[] controls)
duplicate
in interface ReadOnlyLDAPRequest
duplicate
in class BindRequest
controls
- The set of controls to include in the duplicate request.public void toString(java.lang.StringBuilder buffer)
toString
in interface ReadOnlyLDAPRequest
toString
in class LDAPRequest
buffer
- The buffer to which to append a string representation of
this request.