Class AbstractSaslClient

    • Field Detail

      • authorizationId

        private final String authorizationId
      • hasInitialResponse

        private final boolean hasInitialResponse
    • Constructor Detail

      • AbstractSaslClient

        protected AbstractSaslClient​(String mechanismName,
                                     String protocol,
                                     String serverName,
                                     CallbackHandler callbackHandler,
                                     String authorizationId,
                                     boolean hasInitialResponse,
                                     ElytronMessages log)
        Construct a new instance.
        Parameters:
        mechanismName - the SASL mechanism name
        protocol - the protocol
        serverName - the server name
        callbackHandler - the callback handler to use for authentication
        authorizationId - the possibly null protocol-dependent name used for authorization
        hasInitialResponse - true if the mechanism supports an initial response, false otherwise
        log - mechanism specific logger
      • AbstractSaslClient

        @Deprecated
        protected AbstractSaslClient​(String mechanismName,
                                     String protocol,
                                     String serverName,
                                     CallbackHandler callbackHandler,
                                     String authorizationId,
                                     boolean hasInitialResponse)
        Deprecated.
        Construct a new instance.
        Parameters:
        mechanismName - the SASL mechanism name
        protocol - the protocol
        serverName - the server name
        callbackHandler - the callback handler to use for authentication
        authorizationId - the possibly null protocol-dependent name used for authorization
        hasInitialResponse - true if the mechanism supports an initial response, false otherwise
    • Method Detail

      • evaluateChallenge

        public byte[] evaluateChallenge​(byte[] challenge)
                                 throws SaslException
        Evaluate an authentication challenge received from the server.
        Specified by:
        evaluateChallenge in interface SaslClient
        Parameters:
        challenge - the authentication challenge
        Returns:
        the response to send to the server
        Throws:
        SaslException - if there is an error processing the server message
      • hasInitialResponse

        public boolean hasInitialResponse()
        Determines whether this mechanism has an optional initial response. If true, caller should call evaluateChallenge(byte[]) with an empty array to get the initial response.
        Specified by:
        hasInitialResponse in interface SaslClient
        Returns:
        true if this mechanism has an initial response
      • getAuthorizationId

        protected String getAuthorizationId()
        Get the specified authorization ID.
        Returns:
        the authorization ID