Interface SaslServerContext

  • All Superinterfaces:
    SaslContext

    public interface SaslServerContext
    extends SaslContext
    SASL Server operating context used by an Engine that has been configured as a SASL server or that has receiver an AMQP header thereby forcing it into becoming the server side of the SASL exchange.
    • Method Detail

      • setListener

        SaslServerContext setListener​(SaslServerListener listener)
        Sets the SaslServerListener that will be used to driver the server side SASL negotiations with a connected "client". As the client initiates or responds to the various phases of the SASL negotiation the SaslServerListener will be notified and allowed to respond.
        Parameters:
        listener - The SaslServerListener to use for SASL negotiations, cannot be null.
        Returns:
        this server context.
      • sendMechanisms

        SaslServerContext sendMechanisms​(Symbol[] mechanisms)
                                  throws EngineStateException
        Sends the set of supported mechanisms to the SASL client from which it must choose and return one mechanism which will then be the basis for the SASL authentication negotiation.
        Parameters:
        mechanisms - The mechanisms that this server supports.
        Returns:
        this server context.
        Throws:
        EngineStateException - if the engine has already shutdown or failed while processing the mechanisms.
      • sendChallenge

        SaslServerContext sendChallenge​(ProtonBuffer challenge)
                                 throws EngineStateException
        Sends the SASL challenge defined by the SASL mechanism that is in use during this SASL negotiation. The challenge is an opaque binary that is provided to the server by the security mechanism.
        Parameters:
        challenge - The buffer containing the server challenge.
        Returns:
        this server context.
        Throws:
        EngineStateException - if the engine has already shutdown or failed while sending the challenge.
      • sendOutcome

        SaslServerContext sendOutcome​(SaslOutcome outcome,
                                      ProtonBuffer additional)
                               throws EngineStateException
        Sends a response to a server side challenge that comprises the challenge / response exchange for the chosen SASL mechanism.
        Parameters:
        outcome - The outcome of the SASL negotiation to be sent to the client.
        additional - The additional bytes to be sent from the server along with the outcome.
        Returns:
        this server context.
        Throws:
        EngineStateException - if the engine has already shutdown or failed while processing the outcome.
      • saslFailure

        SaslServerContext saslFailure​(javax.security.sasl.SaslException failure)
        Allows the server implementation to fail the SASL negotiation process due to some unrecoverable error. Failing the process will signal the Engine that the SASL process has failed and place the engine in a failed state as well as notify the registered error handler for the Engine.
        Parameters:
        failure - The exception to report to the Engine that describes the failure.
        Returns:
        this server context.