@NotMutable @ThreadSafety(level=NOT_THREADSAFE) public final class UnboundIDDeliveredOTPBindRequest extends SASLBindRequest
DeliverOneTimePasswordExtendedRequest
(which requires the user to
provide an authentication ID and a static password).
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundidds
package structure, are only
supported for use against Ping Identity, UnboundID, and
Nokia/Alcatel-Lucent 8661 server products. These classes provide support
for proprietary functionality or for external specifications that are not
considered stable or mature enough to be guaranteed to work in an
interoperable way with other types of LDAP servers.
UnboundIDDeliveredOTPCredentials ::= SEQUENCE { authenticationID [0] OCTET STRING, authorizationID [1] OCTET STRING OPTIONAL. oneTimePassword [2] OCTET STRING, ... }
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
UNBOUNDID_DELIVERED_OTP_MECHANISM_NAME
The name for the UnboundID delivered OTP SASL mechanism.
|
CRED_TYPE_SASL
VERSION_ELEMENT
Constructor and Description |
---|
UnboundIDDeliveredOTPBindRequest(java.lang.String authenticationID,
java.lang.String authorizationID,
java.lang.String oneTimePassword,
Control... controls)
Creates a new delivered one-time password bind request with the provided
information.
|
Modifier and Type | Method and Description |
---|---|
static UnboundIDDeliveredOTPBindRequest |
decodeSASLCredentials(ASN1OctetString saslCredentials,
Control... controls)
Creates a new delivered one-time password bind request from the information
contained in the provided encoded SASL credentials.
|
UnboundIDDeliveredOTPBindRequest |
duplicate()
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
UnboundIDDeliveredOTPBindRequest |
duplicate(Control[] controls)
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
static ASN1OctetString |
encodeCredentials(java.lang.String authenticationID,
java.lang.String authorizationID,
java.lang.String oneTimePassword)
Encodes the provided information into an ASN.1 octet string that may be
used as the SASL credentials for an UnboundID delivered one-time password
bind request.
|
java.lang.String |
getAuthenticationID()
Retrieves the authentication identity for the bind request.
|
java.lang.String |
getAuthorizationID()
Retrieves the authorization identity for the bind request, if available.
|
int |
getLastMessageID()
Retrieves the message ID for the last LDAP message sent using this request.
|
java.lang.String |
getOneTimePassword()
Retrieves the one-time password for the bind request.
|
java.lang.String |
getSASLMechanismName()
Retrieves the name of the SASL mechanism used in this SASL bind request.
|
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 |
toCode(java.util.List<java.lang.String> lineList,
java.lang.String requestID,
int indentSpaces,
boolean includeProcessing)
Appends a number of lines comprising the Java source code that can be used
to recreate this request to the given list.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this request to the provided buffer.
|
getBindType, responseReceived, sendBindRequest, sendMessage
getOperationType, getRebindRequest
followReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getReferralConnector, getReferralConnectorInternal, getReferralDepth, getResponseTimeoutMillis, hasControl, hasControl, setFollowReferrals, setIntermediateResponseListener, setReferralConnector, setReferralDepth, setResponseTimeoutMillis, toString
@NotNull public static final java.lang.String UNBOUNDID_DELIVERED_OTP_MECHANISM_NAME
public UnboundIDDeliveredOTPBindRequest(@NotNull java.lang.String authenticationID, @Nullable java.lang.String authorizationID, @NotNull java.lang.String oneTimePassword, @Nullable Control... controls)
authenticationID
- The authentication identity for the bind request.
It must not be null
and must in the form
"u:" followed by a username, or "dn:" followed
by a DN.authorizationID
- The authorization identity for the bind request.
It may be null
if the authorization
identity should be the same as the authentication
identity. If an authorization identity is
specified, it must be in the form "u:" followed
by a username, or "dn:" followed by a DN. The
value "dn:" may be used to indicate the
authorization identity of the anonymous user.oneTimePassword
- The one-time password that has been delivered to
the user via the deliver one-time password
extended request. It must not be null
.controls
- The set of controls to include in the bind
request. It may be null
or empty if no
controls should be included.@NotNull public static UnboundIDDeliveredOTPBindRequest decodeSASLCredentials(@NotNull ASN1OctetString saslCredentials, @Nullable Control... controls) throws LDAPException
saslCredentials
- The encoded SASL credentials to be decoded in
order to create this delivered one-time password
bind request. It must not be null
.controls
- The set of controls to include in the bind
request. It may be null
or empty if no
controls should be included.LDAPException
- If the provided credentials are not valid for an
UNBOUNDID-DELIVERED-OTP bind request.@NotNull public java.lang.String getAuthenticationID()
@Nullable public java.lang.String getAuthorizationID()
null
if the authorization identity should be the same as the
authentication identity.@NotNull public java.lang.String getOneTimePassword()
@NotNull protected BindResult process(@NotNull 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.@NotNull public static ASN1OctetString encodeCredentials(@NotNull java.lang.String authenticationID, @Nullable java.lang.String authorizationID, @NotNull java.lang.String oneTimePassword)
authenticationID
- The authentication identity for the bind request.
It must not be null
and must in the form
"u:" followed by a username, or "dn:" followed
by a DN.authorizationID
- The authorization identity for the bind request.
It may be null
if the authorization
identity should be the same as the authentication
identity. If an authorization identity is
specified, it must be in the form "u:" followed
by a username, or "dn:" followed by a DN. The
value "dn:" may be used to indicate the
authorization identity of the anonymous user.oneTimePassword
- The one-time password that has been delivered to
the user via the deliver one-time password
extended request. It must not be null
.@NotNull public UnboundIDDeliveredOTPBindRequest duplicate()
duplicate
in interface ReadOnlyLDAPRequest
duplicate
in class BindRequest
@NotNull public UnboundIDDeliveredOTPBindRequest duplicate(@Nullable Control[] controls)
duplicate
in interface ReadOnlyLDAPRequest
duplicate
in class BindRequest
controls
- The set of controls to include in the duplicate request.@NotNull public java.lang.String getSASLMechanismName()
getSASLMechanismName
in class SASLBindRequest
public int getLastMessageID()
getLastMessageID
in class SASLBindRequest
public void toString(@NotNull 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.public void toCode(@NotNull java.util.List<java.lang.String> lineList, @NotNull java.lang.String requestID, int indentSpaces, boolean includeProcessing)
toCode
in interface ReadOnlyLDAPRequest
toCode
in class SASLBindRequest
lineList
- The list to which the source code lines should
be added.requestID
- The name that should be used as an identifier
for the request. If this is null
or
empty, then a generic ID will be used.indentSpaces
- The number of spaces that should be used to
indent the generated code. It must not be
negative.includeProcessing
- Indicates whether the generated code should
include code required to actually process the
request and handle the result (if true
),
or just to generate the request (if
false
).