Class XOauth2Mechanism
java.lang.Object
org.apache.qpid.protonj2.engine.sasl.client.AbstractMechanism
org.apache.qpid.protonj2.engine.sasl.client.XOauth2Mechanism
- All Implemented Interfaces:
Mechanism
Implements the SASL XOAUTH2 authentication Mechanism .
User name and Password values are sent without being encrypted.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Symbol
A singleton instance of the symbolic mechanism name.Fields inherited from class org.apache.qpid.protonj2.engine.sasl.client.AbstractMechanism
EMPTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetChallengeResponse
(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.getName()
boolean
isApplicable
(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
isEnabledByDefault, toString, verifyCompletion
-
Field Details
-
XOAUTH2
A singleton instance of the symbolic mechanism name.
-
-
Constructor Details
-
XOauth2Mechanism
public XOauth2Mechanism()
-
-
Method Details
-
getName
- Returns:
- the well known name of this SASL mechanism.
-
isApplicable
Description copied from interface:Mechanism
Allows 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
Description copied from interface:Mechanism
Create an initial response based on selected mechanism. May be null if there is no initial response.- Specified by:
getInitialResponse
in interfaceMechanism
- Overrides:
getInitialResponse
in classAbstractMechanism
- Parameters:
credentials
- The credentials that are supplied for this SASL negotiation.- Returns:
- the initial response, or null if there isn't one.
- Throws:
SaslException
- if an error occurs generating the initial response.
-
getChallengeResponse
public ProtonBuffer getChallengeResponse(SaslCredentialsProvider credentials, ProtonBuffer challenge) throws SaslException Description copied from interface:Mechanism
Create a response based on a given challenge from the remote peer.- Specified by:
getChallengeResponse
in interfaceMechanism
- Overrides:
getChallengeResponse
in classAbstractMechanism
- Parameters:
credentials
- The credentials that are supplied for this SASL negotiation.challenge
- The challenge that this Mechanism should response to.- Returns:
- the response that answers the given challenge.
- Throws:
SaslException
- if an error occurs generating the challenge response.
-