Interface SaslServerListener
-
public interface SaslServerListener
Listener for SASL frame arrival to facilitate relevant handling for the SASL negotiation of the server side of the SASL exchange. See the AMQP specification SASL negotiation process overview for related detail.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
handleSaslHeader(SaslServerContext context, AMQPHeader header)
Called when the SASL header has been received and the server is now ready to send the configured SASL mechanisms.void
handleSaslInit(SaslServerContext context, Symbol mechanism, ProtonBuffer initResponse)
Called when a SASL init frame has arrived from the client indicating the chosen SASL mechanism and the initial response data if any.void
handleSaslResponse(SaslServerContext context, ProtonBuffer response)
Called when a SASL response frame has arrived from the client.default void
initialize(SaslServerContext context)
Called to give the application code a clear point to initialize all the Server side expectations.
-
-
-
Method Detail
-
initialize
default void initialize(SaslServerContext context)
Called to give the application code a clear point to initialize all the Server side expectations.The application should use this event to configure the server mechanisms and other server authentication properties.
In the event that the server implementation cannot proceed with SASL authentication it should call the
SaslServerContext.saslFailure(javax.security.sasl.SaslException)
signal theEngine
that it should transition to a failed state.- Parameters:
context
- theSaslServerContext
used to authenticate the connection.
-
handleSaslHeader
void handleSaslHeader(SaslServerContext context, AMQPHeader header)
Called when the SASL header has been received and the server is now ready to send the configured SASL mechanisms. The handler should respond be calling theSaslServerContext.sendMechanisms(Symbol[])
method immediately or later using the same thread that invoked this event handler.In the event that the server implementation cannot proceed with SASL authentication it should call the
SaslServerContext.saslFailure(javax.security.sasl.SaslException)
to fail the SASL negotiation and signal theEngine
that it should transition to a failed state.- Parameters:
context
- theSaslServerContext
object that received the SASL header.header
- the AMQP Header that was read.- See Also:
SaslServerContext.sendMechanisms(Symbol[])
,SaslServerContext.saslFailure(javax.security.sasl.SaslException)
-
handleSaslInit
void handleSaslInit(SaslServerContext context, Symbol mechanism, ProtonBuffer initResponse)
Called when a SASL init frame has arrived from the client indicating the chosen SASL mechanism and the initial response data if any. Based on the chosen mechanism the server handler should provide additional challenges or complete the SASL negotiation by sending an outcome to the client. The handler can either respond immediately or it should response using the same thread that invoked this handler.In the event that the server implementation cannot proceed with SASL authentication it should call the
SaslServerContext.saslFailure(javax.security.sasl.SaslException)
to fail the SASL negotiation and signal theEngine
that it should transition to a failed state.- Parameters:
context
- theSaslServerContext
object that is to process the SASL initial frame.mechanism
- the SASL mechanism that the client side has chosen for negotiations.initResponse
- the initial response sent by the remote.- See Also:
SaslServerContext.sendChallenge(ProtonBuffer)
,SaslServerContext.sendOutcome(SaslOutcome, ProtonBuffer)
,SaslServerContext.saslFailure(javax.security.sasl.SaslException)
-
handleSaslResponse
void handleSaslResponse(SaslServerContext context, ProtonBuffer response)
Called when a SASL response frame has arrived from the client. The server should process the response and either offer additional challenges or complete the SASL negotiations based on the mechanics of the chosen SASL mechanism. The server handler should either respond immediately or should respond from the same thread that the response handler was invoked from.In the event that the server implementation cannot proceed with SASL authentication it should call the
SaslServerContext.saslFailure(javax.security.sasl.SaslException)
to fail the SASL negotiation and signal theEngine
that it should transition to a failed state.- Parameters:
context
- theSaslServerContext
object that is to process the incoming response.response
- the response sent by the remote SASL "client".- See Also:
SaslServerContext.sendChallenge(ProtonBuffer)
,SaslServerContext.sendOutcome(SaslOutcome, ProtonBuffer)
,SaslServerContext.saslFailure(javax.security.sasl.SaslException)
-
-