Class XOauth2Mechanism

  • All Implemented Interfaces:
    Comparable<Mechanism>, Mechanism

    public class XOauth2Mechanism
    extends AbstractMechanism
    Implements the SASL XOAUTH2 authentication Mechanism . User name and Password values are sent without being encrypted.
    • Constructor Detail

      • XOauth2Mechanism

        public XOauth2Mechanism()
    • Method Detail

      • getPriority

        public int getPriority()
        Returns:
        return the relative priority of this SASL mechanism.
      • getName

        public String getName()
        Returns:
        the well known name of this SASL mechanism.
      • getInitialResponse

        public byte[] getInitialResponse()
        Description copied from interface: Mechanism
        Create an initial response based on selected mechanism. May be null if there is no initial response.
        Returns:
        the initial response, or null if there isn't one.
      • getChallengeResponse

        public byte[] getChallengeResponse​(byte[] challenge)
        Description copied from interface: Mechanism
        Create a response based on a given challenge from the remote peer.
        Parameters:
        challenge - the challenge that this Mechanism should response to.
        Returns:
        the response that answers the given challenge.
      • isApplicable

        public boolean isApplicable​(String username,
                                    String password,
                                    Principal localPrincipal)
        Description copied from interface: Mechanism
        Allows the mechanism to determine if it can be used given the authentication provided.
        Parameters:
        username - The user name given to the client for authentication.
        password - The password given to the client for authentication.
        localPrincipal - The local Principal configured for the client for authentication.
        Returns:
        if this Mechanism is able to validate using the given credentials.
      • getAdditionalFailureInformation

        public String getAdditionalFailureInformation()
        Description copied from interface: Mechanism
        Allows a mechanism to report additional information on the reason for authentication failure (e.g. provided in a challenge from the server)
        Returns:
        information on the reason for failure, or null if no such information is available