Class SCRAMBindRequest

    • Constructor Detail

      • SCRAMBindRequest

        public SCRAMBindRequest​(@NotNull
                                java.lang.String username,
                                @NotNull
                                ASN1OctetString password,
                                @Nullable
                                Control... controls)
        Creates a new SCRAM bind request with the provided information.
        Parameters:
        username - The username for this bind request. It must not be null or empty.
        password - The password for this bind request. It must not be null or empty.
        controls - The set of controls to include in the bind request. It may be null or empty if no controls are needed.
    • Method Detail

      • getUsername

        @NotNull
        public final java.lang.String getUsername()
        Retrieves the username for this bind request.
        Returns:
        The password for this bind request.
      • getPasswordString

        @NotNull
        public final java.lang.String getPasswordString()
        Retrieves the password for this bind request, as a string.
        Returns:
        The password for this bind request, as a string.
      • getPasswordBytes

        @NotNull
        public final byte[] getPasswordBytes()
        Retrieves the bytes that comprise the password for this bind request.
        Returns:
        The bytes that comprise the password for this bind request.
      • getDigestAlgorithmName

        @NotNull
        protected abstract java.lang.String getDigestAlgorithmName()
        Retrieves the name of the digest algorithm that will be used in the authentication processing.
        Returns:
        The name of the digest algorithm that will be used in the authentication processing.
      • getMACAlgorithmName

        @NotNull
        protected abstract java.lang.String getMACAlgorithmName()
        Retrieves the name of the MAC algorithm that will be used in the authentication processing.
        Returns:
        The name of the MAC algorithm that will be used in the authentication processing.
      • process

        @NotNull
        protected final 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 class BindRequest
        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.
      • getRebindRequest

        @NotNull
        public abstract SCRAMBindRequest 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 class BindRequest
        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.
      • duplicate

        @NotNull
        public abstract SCRAMBindRequest duplicate​(@NotNull
                                                   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 interface ReadOnlyLDAPRequest
        Specified by:
        duplicate in class BindRequest
        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.
      • toString

        public abstract void toString​(@NotNull
                                      java.lang.StringBuilder buffer)
        Appends a string representation of this request to the provided buffer.
        Specified by:
        toString in interface ReadOnlyLDAPRequest
        Specified by:
        toString in class LDAPRequest
        Parameters:
        buffer - The buffer to which to append a string representation of this request.
      • toCode

        public abstract 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 interface ReadOnlyLDAPRequest
        Overrides:
        toCode in class SASLBindRequest
        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 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).