- All Implemented Interfaces:
- Direct Known Subclasses:
public abstract class AbstractMechanism extends java.lang.Object implements MechanismBase class for SASL Authentication Mechanism that implements the basic methods of a Mechanism class.
Constructors Constructor Description
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
getChallengeResponse(SaslCredentialsProvider credentials, ProtonBuffer challenge)Create a response based on a given challenge from the remote peer.
getInitialResponse(SaslCredentialsProvider credentials)Create an initial response based on selected mechanism.
isEnabledByDefault()Allows the mechanism to indicate if it is enabled by default, or only when explicitly enabled through configuring the permitted SASL mechanisms.
verifyCompletion()Verifies that the SASL exchange has completed successfully.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
protected static final ProtonBuffer EMPTY
public ProtonBuffer getInitialResponse(SaslCredentialsProvider credentials) throws javax.security.sasl.SaslExceptionCreate an initial response based on selected mechanism. May be null if there is no initial response.
public ProtonBuffer getChallengeResponse(SaslCredentialsProvider credentials, ProtonBuffer challenge) throws javax.security.sasl.SaslExceptionCreate a response based on a given challenge from the remote peer.
- Specified by:
credentials- The credentials that are supplied for this SASL negotiation.
challenge- The challenge that this Mechanism should response to.
- the response that answers the given challenge.
javax.security.sasl.SaslException- if an error occurs generating the challenge response.
public void verifyCompletion() throws javax.security.sasl.SaslExceptionVerifies that the SASL exchange has completed successfully. This is an opportunity for the mechanism to ensure that all mandatory steps have been completed successfully and to cleanup and resources that are held by this Mechanism.
public boolean isEnabledByDefault()Allows the mechanism to indicate if it is enabled by default, or only when explicitly enabled through configuring the permitted SASL mechanisms. Any mechanism selection logic should examine this value along with the configured allowed mechanism and decide if this one should be used. Typically most mechanisms can be enabled by default but some require explicit configuration in order to operate which implies that selecting them by default would always cause an authentication error if that mechanism matches the highest priority value offered by the remote peer.
public java.lang.String toString()