Class PlainMechanism
- java.lang.Object
-
- org.apache.qpid.protonj2.engine.sasl.client.AbstractMechanism
-
- org.apache.qpid.protonj2.engine.sasl.client.PlainMechanism
-
- All Implemented Interfaces:
Mechanism
public class PlainMechanism extends AbstractMechanism
Implements the SASL PLAIN authentication Mechanism. User name and Password values are sent without being encrypted.
-
-
Field Summary
Fields Modifier and Type Field Description static SymbolPLAINA singleton instance of the symbolic mechanism name.-
Fields inherited from class org.apache.qpid.protonj2.engine.sasl.client.AbstractMechanism
EMPTY
-
-
Constructor Summary
Constructors Constructor Description PlainMechanism()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProtonBuffergetInitialResponse(SaslCredentialsProvider credentials)Create an initial response based on selected mechanism.SymbolgetName()booleanisApplicable(SaslCredentialsProvider credentials)Allows the Mechanism to determine if it is a valid choice based on the configured credentials at the time of selection.-
Methods inherited from class org.apache.qpid.protonj2.engine.sasl.client.AbstractMechanism
getChallengeResponse, isEnabledByDefault, toString, verifyCompletion
-
-
-
-
Field Detail
-
PLAIN
public static final Symbol PLAIN
A singleton instance of the symbolic mechanism name.
-
-
Method Detail
-
getName
public Symbol getName()
- Returns:
- the well known name of this SASL mechanism.
-
isApplicable
public boolean isApplicable(SaslCredentialsProvider credentials)
Description copied from interface:MechanismAllows the Mechanism to determine if it is a valid choice based on the configured credentials at the time of selection.- Parameters:
credentials- the login credentials available at the time of mechanism selection.- Returns:
- true if the mechanism can be used with the provided credentials
-
getInitialResponse
public ProtonBuffer getInitialResponse(SaslCredentialsProvider credentials) throws javax.security.sasl.SaslException
Description copied from interface:MechanismCreate an initial response based on selected mechanism. May be null if there is no initial response.- Specified by:
getInitialResponsein interfaceMechanism- Overrides:
getInitialResponsein classAbstractMechanism- Parameters:
credentials- The credentials that are supplied for this SASL negotiation.- Returns:
- the initial response, or null if there isn't one.
- Throws:
javax.security.sasl.SaslException- if an error occurs generating the initial response.
-
-