@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class UnboundIDYubiKeyOTPBindRequest extends SASLBindRequest
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 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.
UnboundIDYubiKeyCredentials ::= SEQUENCE { authenticationID [0] OCTET STRING, authorizationID [1] OCTET STRING OPTIONAL, staticPassword [2] OCTET STRING OPTIONAL, yubiKeyOTP [3] OCTET STRING, ... }
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
UNBOUNDID_YUBIKEY_OTP_MECHANISM_NAME
The name for the UnboundID YubiKey SASL mechanism.
|
CRED_TYPE_SASL
VERSION_ELEMENT
Constructor and Description |
---|
UnboundIDYubiKeyOTPBindRequest(java.lang.String authenticationID,
java.lang.String authorizationID,
byte[] staticPassword,
java.lang.String yubiKeyOTP,
Control... controls)
Creates a new UNBOUNDID-YUBIKEY-OTP bind request with the provided
information.
|
UnboundIDYubiKeyOTPBindRequest(java.lang.String authenticationID,
java.lang.String authorizationID,
java.lang.String staticPassword,
java.lang.String yubiKeyOTP,
Control... controls)
Creates a new UNBOUNDID-YUBIKEY-OTP bind request with the provided
information.
|
Modifier and Type | Method and Description |
---|---|
static UnboundIDYubiKeyOTPBindRequest |
decodeCredentials(ASN1OctetString saslCredentials,
Control... controls)
Creates a new UNBOUNDID-YUBIKEY-OTP SASL bind request decoded from the
provided SASL credentials.
|
UnboundIDYubiKeyOTPBindRequest |
duplicate()
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
UnboundIDYubiKeyOTPBindRequest |
duplicate(Control[] controls)
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
ASN1OctetString |
encodeCredentials()
Retrieves an ASN.1 octet string containing the encoded credentials for this
bind request.
|
static ASN1OctetString |
encodeCredentials(java.lang.String authenticationID,
java.lang.String authorizationID,
ASN1OctetString staticPassword,
java.lang.String yubiKeyOTP)
Encodes the provided information into an ASN.1 octet string suitable for
use as the SASL credentials for an UNBOUNDID-YUBIKEY-OTP bind request.
|
java.lang.String |
getAuthenticationID()
Retrieves the authentication ID for the bind request.
|
java.lang.String |
getAuthorizationID()
Retrieves the authorization ID for the bind request, if any.
|
int |
getLastMessageID()
Retrieves the message ID for the last LDAP message sent using this request.
|
java.lang.String |
getSASLMechanismName()
Retrieves the name of the SASL mechanism used in this SASL bind request.
|
byte[] |
getStaticPasswordBytes()
Retrieves the bytes that comprise the static password for the bind request,
if any.
|
java.lang.String |
getStaticPasswordString()
Retrieves the string representation of the static password for the bind
request, if any.
|
java.lang.String |
getYubiKeyOTP()
Retrieves the YubiKey-generated one-time password to include in the 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 |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this request to the provided buffer.
|
getBindType, responseReceived, sendBindRequest, sendMessage, toCode
getOperationType, getRebindRequest
followReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getReferralConnector, getResponseTimeoutMillis, hasControl, hasControl, setFollowReferrals, setIntermediateResponseListener, setReferralConnector, setResponseTimeoutMillis, toString
public static final java.lang.String UNBOUNDID_YUBIKEY_OTP_MECHANISM_NAME
public UnboundIDYubiKeyOTPBindRequest(java.lang.String authenticationID, java.lang.String authorizationID, java.lang.String staticPassword, java.lang.String yubiKeyOTP, Control... controls)
authenticationID
- The authentication ID for the bind request. It
must not be null
, and must have the form
"dn:" followed by the DN of the target user or
"u:" followed by the the username of the target
user.authorizationID
- The authorization ID for the bind request. It
may be null
if the authorization identity
should be the same as the authentication
identity.staticPassword
- The static password for the user specified as the
authentication identity. It may be null
if authentication should be performed using only
the YubiKey OTP.yubiKeyOTP
- The one-time password generated by the YubiKey
device. It must not be null
.controls
- The set of controls to include in the bind
request. It may be null
or empty if
there should not be any request controls.public UnboundIDYubiKeyOTPBindRequest(java.lang.String authenticationID, java.lang.String authorizationID, byte[] staticPassword, java.lang.String yubiKeyOTP, Control... controls)
authenticationID
- The authentication ID for the bind request. It
must not be null
, and must have the form
"dn:" followed by the DN of the target user or
"u:" followed by the the username of the target
user.authorizationID
- The authorization ID for the bind request. It
may be null
if the authorization identity
should be the same as the authentication
identity.staticPassword
- The static password for the user specified as the
authentication identity. It may be null
if authentication should be performed using only
the YubiKey OTP.yubiKeyOTP
- The one-time password generated by the YubiKey
device. It must not be null
.controls
- The set of controls to include in the bind
request. It may be null
or empty if
there should not be any request controls.public static UnboundIDYubiKeyOTPBindRequest decodeCredentials(ASN1OctetString saslCredentials, Control... controls) throws LDAPException
saslCredentials
- The SASL credentials to decode in order to create
the UNBOUNDID-YUBIKEY-OTP SASL bind request. It
must not be null
.controls
- The set of controls to include in the bind
request. This may be null
or empty if no
controls should be included in the request.LDAPException
- If the provided credentials cannot be decoded to a
valid UNBOUNDID-YUBIKEY-OTP bind request.public java.lang.String getAuthenticationID()
public java.lang.String getAuthorizationID()
null
if the
authorization identity should match the authentication identity.public java.lang.String getStaticPasswordString()
null
if there is no static password.public byte[] getStaticPasswordBytes()
null
if there is no static password.public java.lang.String getYubiKeyOTP()
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 ASN1OctetString encodeCredentials()
public static ASN1OctetString encodeCredentials(java.lang.String authenticationID, java.lang.String authorizationID, ASN1OctetString staticPassword, java.lang.String yubiKeyOTP)
authenticationID
- The authentication ID for the bind request. It
must not be null
, and must have the form
"dn:" followed by the DN of the target user or
"u:" followed by the the username of the target
user.authorizationID
- The authorization ID for the bind request. It
may be null
if the authorization identity
should be the same as the authentication
identity.staticPassword
- The static password for the user specified as the
authentication identity. It may be null
if authentication should be performed using only
the YubiKey OTP.yubiKeyOTP
- The one-time password generated by the YubiKey
device. It must not be null
.public UnboundIDYubiKeyOTPBindRequest duplicate()
duplicate
in interface ReadOnlyLDAPRequest
duplicate
in class BindRequest
public UnboundIDYubiKeyOTPBindRequest duplicate(Control[] controls)
duplicate
in interface ReadOnlyLDAPRequest
duplicate
in class BindRequest
controls
- The set of controls to include in the duplicate request.public java.lang.String getSASLMechanismName()
getSASLMechanismName
in class SASLBindRequest
public int getLastMessageID()
getLastMessageID
in class SASLBindRequest
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.