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,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.
This SASL bind request has a mechanism of "UNBOUNDID-EXTERNALLY-PROCESSED-AUTHENTICATION" and must include SASL credentials with the following encoding:
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.
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name for the UnboundID externally-processed authentication SASL mechanism.Fields inherited from class com.unboundid.ldap.sdk.SASLBindRequest
CRED_TYPE_SASLFields inherited from class com.unboundid.ldap.sdk.BindRequest
VERSION_ELEMENT -
Constructor Summary
ConstructorsConstructorDescriptionUnboundIDExternallyProcessedAuthenticationBindRequest(String authenticationID, String externalMechanismName, boolean externalAuthWasSuccessful, String externalAuthFailureReason, boolean externalAuthWasPasswordBased, boolean externalAuthWasSecure, String endClientIPAddress, Map<String, String> additionalAccessLogProperties, Control... controls) Creates a new UNBOUNDID-EXTERNALLY-PROCESSED-AUTHENTICATION bind request with the provided information. -
Method Summary
Modifier and TypeMethodDescriptiondecodeSASLCredentials(ASN1OctetString saslCredentials, Control... controls) Creates a new UNBOUNDID-EXTERNALLY-PROCESSED-AUTHENTICATION bind request decoded from the provided information.Creates a new instance of this LDAP request that may be modified without impacting this request.Creates a new instance of this LDAP request that may be modified without impacting this request.booleanIndicates whether the external authentication processing involved a password.booleanIndicates whether the external authentication processing is considered to have been secure.booleanIndicates whether the external authentication attempt is considered to have been successful.Retrieves a map of additional properties that should be recorded in the server's access log for the external authentication attempt.Retrieves the authentication ID that identifies the user for whom the external authentication processing was performed.Retrieves an encoded representation of the SASL credentials for this bind request.Retrieves the IPv4 or IPv6 address of the end client involved in the external authentication processing, if available.Retrieves the reason that the external authentication attempt was considered a failure, if available.Retrieves the name of the mechanism used for the external authentication attempt.intRetrieves the message ID for the last LDAP message sent using this request.getRebindRequest(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.Retrieves the name of the SASL mechanism used in this SASL bind request.protected BindResultprocess(LDAPConnection connection, int depth) Sends this bind request to the target server over the provided connection and returns the corresponding response.voidAppends a number of lines comprising the Java source code that can be used to recreate this request to the given list.voidtoString(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, sendMessageMethods inherited from class com.unboundid.ldap.sdk.BindRequest
getOperationTypeMethods inherited from class com.unboundid.ldap.sdk.LDAPRequest
followReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getReferralConnector, getReferralConnectorInternal, getReferralDepth, getResponseTimeoutMillis, hasControl, hasControl, setFollowReferrals, setIntermediateResponseListener, setReferralConnector, setReferralDepth, setResponseTimeoutMillis, toString
-
Field Details
-
UNBOUNDID_EXTERNALLY_PROCESSED_AUTH_MECHANISM_NAME
The name for the UnboundID externally-processed authentication SASL mechanism.- See Also:
-
-
Constructor Details
-
UnboundIDExternallyProcessedAuthenticationBindRequest
public UnboundIDExternallyProcessedAuthenticationBindRequest(@NotNull String authenticationID, @NotNull String externalMechanismName, boolean externalAuthWasSuccessful, @Nullable String externalAuthFailureReason, boolean externalAuthWasPasswordBased, boolean externalAuthWasSecure, @Nullable String endClientIPAddress, @Nullable Map<String, 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 benullif the external authentication attempt succeeded, and may benullif 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 benullif 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 benullor empty if no additional access log properties are required.controls- The set of controls to include in the request. It may benullor empty if no request controls are needed.
-
-
Method Details
-
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 benullor 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
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
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
Indicates whether the external authentication attempt is considered to have been successful.- Returns:
trueif the external authentication attempt was considered successful, orfalseif not.
-
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
nullif no failure reason is available.
-
externalAuthenticationWasPasswordBased
Indicates whether the external authentication processing involved a password.- Returns:
trueif the external authentication processing involved a password, orfalseif not.
-
externalAuthenticationWasSecure
Indicates whether the external authentication processing is considered to have been secure.- Returns:
trueif the external authentication processing was considered secure, orfalseif not.
-
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
nullif this is not available.
-
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
Retrieves the name of the SASL mechanism used in this SASL bind request.- Specified by:
getSASLMechanismNamein classSASLBindRequest- Returns:
- The name of the SASL mechanism used in this SASL bind request.
-
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:
processin 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
Retrieves the message ID for the last LDAP message sent using this request.- Overrides:
getLastMessageIDin 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
Creates a new instance of this LDAP request that may be modified without impacting this request.- Specified by:
duplicatein interfaceReadOnlyLDAPRequest- Specified by:
duplicatein 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:
duplicatein interfaceReadOnlyLDAPRequest- Specified by:
duplicatein 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 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:
getRebindRequestin 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
nullto indicate that automatic re-binding is not supported for this type of bind request.
-
toString
Appends a string representation of this request to the provided buffer.- Specified by:
toStringin interfaceReadOnlyLDAPRequest- Specified by:
toStringin classLDAPRequest- Parameters:
buffer- The buffer to which to append a string representation of this request.
-
toCode
public void toCode(@NotNull List<String> lineList, @NotNull 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:
toCodein interfaceReadOnlyLDAPRequest- Overrides:
toCodein 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 isnullor 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).
-