Class UnboundIDExternallyProcessedAuthenticationBindRequest
- java.lang.Object
-
- com.unboundid.ldap.sdk.LDAPRequest
-
- com.unboundid.ldap.sdk.BindRequest
-
- com.unboundid.ldap.sdk.SASLBindRequest
-
- com.unboundid.ldap.sdk.unboundidds.UnboundIDExternallyProcessedAuthenticationBindRequest
-
- All Implemented Interfaces:
ReadOnlyLDAPRequest
,java.io.Serializable
@ThreadSafety(level=NOT_THREADSAFE) public final class UnboundIDExternallyProcessedAuthenticationBindRequest extends SASLBindRequest
This class provides support for an UnboundID-proprietary SASL mechanism that may be used to indicate that a user has attempted authentication, whether successfully or not, through some mechanism that is external to the Directory Server. If this mechanism is supported in the server, then attempting to authenticate with it will not change the identity of the client connection, but will perform additional processing that would normally be completed during a more traditional authentication attempt.
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.
This SASL bind request has a mechanism of "UNBOUNDID-EXTERNALLY-PROCESSED-AUTHENTICATION" and must include SASL credentials with the following encoding:ExternallyProcessedAuthenticationCredentials ::= SEQUENCE { authenticationID [0] OCTET STRING, externalMechanismName [1] OCTET STRING, externalAuthenticationWasSuccessful [2] BOOLEAN, externalAuthenticationFailureReason [3] OCTET STRING OPTIONAL, externalAuthenticationWasPasswordBased [4] BOOLEAN DEFAULT TRUE, externalAuthenticationWasSecure [5] BOOLEAN DEFAULT FALSE, endClientIPAddress [6] OCTET STRING OPTIONAL, additionalAccessLogProperties [7] SEQUENCE OF SEQUENCE { propertyName OCTET STRING, propertyValue OCTET STRING } OPTIONAL, ... }
In the event that the external authentication was considered successful, the server will ensure that the target user's account is in a usable state and, if not, will return a failure response. If the external authentication was successful and the user's account is usable, then the server will make any appropriate password policy state updates (e.g., clearing previous authentication failures, updating the user's last login time and IP address, etc.) and return a success result.
In the event that the external authentication was not considered successful, the server may also make corresponding password policy state updates (e.g., incrementing the number of authentication failures and locking the account if appropriate) before returning a failure result.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
UNBOUNDID_EXTERNALLY_PROCESSED_AUTH_MECHANISM_NAME
The name for the UnboundID externally-processed authentication SASL mechanism.-
Fields inherited from class com.unboundid.ldap.sdk.SASLBindRequest
CRED_TYPE_SASL
-
Fields inherited from class com.unboundid.ldap.sdk.BindRequest
VERSION_ELEMENT
-
-
Constructor Summary
Constructors Constructor Description UnboundIDExternallyProcessedAuthenticationBindRequest(java.lang.String authenticationID, java.lang.String externalMechanismName, boolean externalAuthWasSuccessful, java.lang.String externalAuthFailureReason, boolean externalAuthWasPasswordBased, boolean externalAuthWasSecure, java.lang.String endClientIPAddress, java.util.Map<java.lang.String,java.lang.String> additionalAccessLogProperties, Control... controls)
Creates a new UNBOUNDID-EXTERNALLY-PROCESSED-AUTHENTICATION bind request with the provided information.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UnboundIDExternallyProcessedAuthenticationBindRequest
decodeSASLCredentials(ASN1OctetString saslCredentials, Control... controls)
Creates a new UNBOUNDID-EXTERNALLY-PROCESSED-AUTHENTICATION bind request decoded from the provided information.UnboundIDExternallyProcessedAuthenticationBindRequest
duplicate()
Creates a new instance of this LDAP request that may be modified without impacting this request.UnboundIDExternallyProcessedAuthenticationBindRequest
duplicate(Control[] controls)
Creates a new instance of this LDAP request that may be modified without impacting this request.boolean
externalAuthenticationWasPasswordBased()
Indicates whether the external authentication processing involved a password.boolean
externalAuthenticationWasSecure()
Indicates whether the external authentication processing is considered to have been secure.boolean
externalAuthenticationWasSuccessful()
Indicates whether the external authentication attempt is considered to have been successful.java.util.Map<java.lang.String,java.lang.String>
getAdditionalAccessLogProperties()
Retrieves a map of additional properties that should be recorded in the server's access log for the external authentication attempt.java.lang.String
getAuthenticationID()
Retrieves the authentication ID that identifies the user for whom the external authentication processing was performed.ASN1OctetString
getEncodedCredentials()
Retrieves an encoded representation of the SASL credentials for this bind request.java.lang.String
getEndClientIPAddress()
Retrieves the IPv4 or IPv6 address of the end client involved in the external authentication processing, if available.java.lang.String
getExternalAuthenticationFailureReason()
Retrieves the reason that the external authentication attempt was considered a failure, if available.java.lang.String
getExternalMechanismName()
Retrieves the name of the mechanism used for the external authentication attempt.int
getLastMessageID()
Retrieves the message ID for the last LDAP message sent using this request.UnboundIDExternallyProcessedAuthenticationBindRequest
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.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.-
Methods inherited from class com.unboundid.ldap.sdk.SASLBindRequest
getBindType, responseReceived, sendBindRequest, sendMessage
-
Methods inherited from class com.unboundid.ldap.sdk.BindRequest
getOperationType
-
Methods inherited from class com.unboundid.ldap.sdk.LDAPRequest
followReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getReferralConnector, getResponseTimeoutMillis, hasControl, hasControl, setFollowReferrals, setIntermediateResponseListener, setReferralConnector, setResponseTimeoutMillis, toString
-
-
-
-
Field Detail
-
UNBOUNDID_EXTERNALLY_PROCESSED_AUTH_MECHANISM_NAME
@NotNull public static final java.lang.String UNBOUNDID_EXTERNALLY_PROCESSED_AUTH_MECHANISM_NAME
The name for the UnboundID externally-processed authentication SASL mechanism.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UnboundIDExternallyProcessedAuthenticationBindRequest
public UnboundIDExternallyProcessedAuthenticationBindRequest(@NotNull java.lang.String authenticationID, @NotNull java.lang.String externalMechanismName, boolean externalAuthWasSuccessful, @Nullable java.lang.String externalAuthFailureReason, boolean externalAuthWasPasswordBased, boolean externalAuthWasSecure, @Nullable java.lang.String endClientIPAddress, @Nullable java.util.Map<java.lang.String,java.lang.String> additionalAccessLogProperties, @Nullable Control... controls)
Creates a new UNBOUNDID-EXTERNALLY-PROCESSED-AUTHENTICATION bind request with the provided information.- Parameters:
authenticationID
- The authentication ID that identifies the user for whom the external authentication processing was performed. This should be either "dn:" followed by the DN of the target user's entry, or "u:" followed by a username. This must not benull
.externalMechanismName
- The name of the mechanism used for the external authentication attempt. This must not benull
.externalAuthWasSuccessful
- Indicates whether the external authentication attempt is considered to have been successful.externalAuthFailureReason
- The reason that the external authentication attempt was considered a failure. This should benull
if the external authentication attempt succeeded, and may benull
if the external authentication attempt failed but no failure reason is available.externalAuthWasPasswordBased
- Indicates whether the external authentication processing involved a password.externalAuthWasSecure
- Indicates whether the external authentication processing was considered secure. A mechanism should only be considered secure if all credentials were protected in all communication.endClientIPAddress
- The IPv4 or IPv6 address of the end client involved in the external authentication processing. This may benull
if the end client address is not available.additionalAccessLogProperties
- A map of additional properties that should be recorded in the server's access log for the external authentication attempt. This may benull
or empty if no additional access log properties are required.controls
- The set of controls to include in the request. It may benull
or empty if no request controls are needed.
-
-
Method Detail
-
decodeSASLCredentials
@NotNull public static UnboundIDExternallyProcessedAuthenticationBindRequest decodeSASLCredentials(@NotNull ASN1OctetString saslCredentials, @Nullable Control... controls) throws LDAPException
Creates a new UNBOUNDID-EXTERNALLY-PROCESSED-AUTHENTICATION bind request decoded from the provided information.- Parameters:
saslCredentials
- The encoded SASL credentials to be decoded. It must not benull
.controls
- The set of controls to include in the request. It may benull
or empty if no request controls are needed.- Returns:
- The decoded UNBOUNDID-EXTERNALLY-PROCESSED-AUTHENTICATION bind request.
- Throws:
LDAPException
- If the provided SASL credentials are not valid for am UNBOUNDID-EXTERNALLY-PROCESSED-AUTHENTICATION bind request
-
getAuthenticationID
@NotNull public java.lang.String getAuthenticationID()
Retrieves the authentication ID that identifies the user for whom the external authentication processing was performed.- Returns:
- The authentication ID that identifies the user for whom the external authentication processing was performed.
-
getExternalMechanismName
@NotNull public java.lang.String getExternalMechanismName()
Retrieves the name of the mechanism used for the external authentication attempt.- Returns:
- The name of the mechanism used for the external authentication attempt.
-
externalAuthenticationWasSuccessful
public boolean externalAuthenticationWasSuccessful()
Indicates whether the external authentication attempt is considered to have been successful.- Returns:
true
if the external authentication attempt was considered successful, orfalse
if not.
-
getExternalAuthenticationFailureReason
@Nullable public java.lang.String getExternalAuthenticationFailureReason()
Retrieves the reason that the external authentication attempt was considered a failure, if available.- Returns:
- The reason that the external authentication attempt was considered
a failure, or
null
if no failure reason is available.
-
externalAuthenticationWasPasswordBased
public boolean externalAuthenticationWasPasswordBased()
Indicates whether the external authentication processing involved a password.- Returns:
true
if the external authentication processing involved a password, orfalse
if not.
-
externalAuthenticationWasSecure
public boolean externalAuthenticationWasSecure()
Indicates whether the external authentication processing is considered to have been secure.- Returns:
true
if the external authentication processing was considered secure, orfalse
if not.
-
getEndClientIPAddress
@Nullable public java.lang.String getEndClientIPAddress()
Retrieves the IPv4 or IPv6 address of the end client involved in the external authentication processing, if available.- Returns:
- The IPv4 or IPv6 address of the end client involved in the
external authentication processing, or
null
if this is not available.
-
getAdditionalAccessLogProperties
@NotNull public java.util.Map<java.lang.String,java.lang.String> getAdditionalAccessLogProperties()
Retrieves a map of additional properties that should be recorded in the server's access log for the external authentication attempt.- Returns:
- A map of additional properties that should be recorded in the server's access log for the external authentication attempt, or an empty map if there are no additional log properties.
-
getSASLMechanismName
@NotNull public java.lang.String getSASLMechanismName()
Retrieves the name of the SASL mechanism used in this SASL bind request.- Specified by:
getSASLMechanismName
in classSASLBindRequest
- Returns:
- The name of the SASL mechanism used in this SASL bind request.
-
getEncodedCredentials
@NotNull public ASN1OctetString getEncodedCredentials()
Retrieves an encoded representation of the SASL credentials for this bind request.- Returns:
- An encoded representation of the SASL credentials for this bind request.
-
process
@NotNull protected BindResult process(@NotNull LDAPConnection connection, int depth) throws LDAPException
Sends this bind request to the target server over the provided connection and returns the corresponding response.- Specified by:
process
in classBindRequest
- Parameters:
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.- Returns:
- The bind response read from the server.
- Throws:
LDAPException
- If a problem occurs while sending the request or reading the response.
-
getLastMessageID
public int getLastMessageID()
Retrieves the message ID for the last LDAP message sent using this request.- Overrides:
getLastMessageID
in classSASLBindRequest
- Returns:
- The message ID for the last LDAP message sent using this request, or -1 if it no LDAP messages have yet been sent using this request.
-
duplicate
@NotNull public UnboundIDExternallyProcessedAuthenticationBindRequest duplicate()
Creates a new instance of this LDAP request that may be modified without impacting this request.- Specified by:
duplicate
in interfaceReadOnlyLDAPRequest
- Specified by:
duplicate
in classBindRequest
- Returns:
- A new instance of this LDAP request that may be modified without impacting this request.
-
duplicate
@NotNull public UnboundIDExternallyProcessedAuthenticationBindRequest duplicate(@Nullable Control[] controls)
Creates a new instance of this LDAP request that may be modified without impacting this request. The provided controls will be used for the new request instead of duplicating the controls from this request.- Specified by:
duplicate
in interfaceReadOnlyLDAPRequest
- Specified by:
duplicate
in classBindRequest
- Parameters:
controls
- The set of controls to include in the duplicate request.- Returns:
- A new instance of this LDAP request that may be modified without impacting this request.
-
getRebindRequest
@NotNull public UnboundIDExternallyProcessedAuthenticationBindRequest getRebindRequest(@NotNull 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. This may be used in an attempt to automatically re-establish a connection that is lost, or potentially when following a referral to another directory instance.
It is recommended that all bind request types which implement this capability be implemented so that the elements needed to create a new request are immutable. If this is not done, then changes made to a bind request object may alter the authentication/authorization identity and/or credentials associated with that request so that a rebind request created from it will not match the original request used to authenticate on a connection.- Overrides:
getRebindRequest
in classBindRequest
- Parameters:
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.- Returns:
- A bind request that may be used to re-bind using the same
authentication type and credentials as previously used to perform
the initial bind, or
null
to indicate that automatic re-binding is not supported for this type of bind request.
-
toString
public void toString(@NotNull java.lang.StringBuilder buffer)
Appends a string representation of this request to the provided buffer.- Specified by:
toString
in interfaceReadOnlyLDAPRequest
- Specified by:
toString
in classLDAPRequest
- Parameters:
buffer
- The buffer to which to append a string representation of this request.
-
toCode
public void toCode(@NotNull java.util.List<java.lang.String> lineList, @NotNull 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.- Specified by:
toCode
in interfaceReadOnlyLDAPRequest
- Overrides:
toCode
in classSASLBindRequest
- Parameters:
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 isnull
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 (iftrue
), or just to generate the request (iffalse
).
-
-