Interface SaslClientListener
- All Known Implementing Classes:
SaslAuthenticator
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleSaslChallenge(SaslClientContext context, ProtonBuffer challenge) Called when a SASL challenge frame has arrived and its effect applied, indicating the challenge sent by the 'server' peer.voidhandleSaslMechanisms(SaslClientContext context, Symbol[] mechanisms) Called when a SASL mechanisms frame has arrived and its effect applied, indicating the offered mechanisms sent by the 'server' peer.voidhandleSaslOutcome(SaslClientContext context, SaslOutcome outcome, ProtonBuffer additional) Called when a SASL outcome frame has arrived and its effect applied, indicating the outcome and any success additional data sent by the 'server' peer.default voidinitialize(SaslClientContext context) Called to give the application code a clear point to initialize all the client side expectations.
-
Method Details
-
initialize
Called to give the application code a clear point to initialize all the client side expectations.The application should use this event to configure the client mechanisms and other client authentication properties.
In the event that the client implementation cannot proceed with SASL authentication it should call the
SaslClientContext.saslFailure(javax.security.sasl.SaslException)to signal theEnginethat it should transition to a failed state.- Parameters:
context- theSaslClientContextused to authenticate the connection.
-
handleSaslMechanisms
Called when a SASL mechanisms frame has arrived and its effect applied, indicating the offered mechanisms sent by the 'server' peer. The client should respond to the mechanisms event by selecting one from the offered list and calling theSaslClientContext.sendChosenMechanism(Symbol, String, ProtonBuffer)method immediately or later using the same thread that triggered this event.In the event that the client implementation cannot proceed with SASL authentication it should call the
SaslClientContext.saslFailure(javax.security.sasl.SaslException)to fail the SASL negotiation and signal theEnginethat it should transition to a failed state.- Parameters:
context- theSaslClientContextthat is to handle the mechanism selectionmechanisms- the mechanisms that the remote supports.- See Also:
-
handleSaslChallenge
Called when a SASL challenge frame has arrived and its effect applied, indicating the challenge sent by the 'server' peer. The client should respond to the mechanisms event by selecting one from the offered list and calling theSaslClientContext.sendResponse(ProtonBuffer)method immediately or later using the same thread that triggered this event.In the event that the client implementation cannot proceed with SASL authentication it should call the
SaslClientContext.saslFailure(javax.security.sasl.SaslException)to fail the SASL negotiation and signal theEnginethat it should transition to a failed state.- Parameters:
context- theSaslClientContextthat is to handle the SASL challenge.challenge- the challenge bytes sent from the SASL server.- See Also:
-
handleSaslOutcome
Called when a SASL outcome frame has arrived and its effect applied, indicating the outcome and any success additional data sent by the 'server' peer. The client can consider the SASL negotiations complete following this event. The client should respond appropriately to the outcome whose state can indicate that negotiations have failed and the server has not authenticated the client.In the event that the client implementation cannot proceed with SASL authentication it should call the
SaslClientContext.saslFailure(javax.security.sasl.SaslException)to fail the SASL negotiation and signal theEnginethat it should transition to a failed state.- Parameters:
context- theSaslClientContextthat is to handle the resulting SASL outcome.outcome- the outcome that was supplied by the SASL "server".additional- the additional data sent from the server, or null if none.- See Also:
-