Class Auth

  • All Implemented Interfaces:
    StreamElement

    public final class Auth
    extends Object
    implements StreamElement
    The implementation of the <auth/> element to initialize the SASL authentication process.

    6.4.2. Initiation

    In order to begin the SASL negotiation, the initiating entity sends an <auth/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl' namespace and includes an appropriate value for the 'mechanism' attribute, thus starting the handshake for that particular authentication mechanism. This element MAY contain XML character data (in SASL terminology, the "initial response") if the mechanism supports or requires it. If the initiating entity needs to send a zero-length initial response, it MUST transmit the response as a single equals sign character ("="), which indicates that the response is present but contains no data.

    If the initiating entity subsequently sends another <auth/> element and the ongoing authentication handshake has not yet completed, the receiving entity MUST discard the ongoing handshake and MUST process a new handshake for the subsequently requested SASL mechanism.

    This class is immutable.

    • Constructor Detail

      • Auth

        public Auth​(String mechanism,
                    byte[] initialResponse)
        Parameters:
        mechanism - The SASL mechanism.
        initialResponse - The initial response.
    • Method Detail

      • getMechanism

        public final String getMechanism()
        Gets the mechanism.
        Returns:
        The mechanism.
      • getInitialResponse

        public final byte[] getInitialResponse()
        Gets the initial response.
        Returns:
        The initial response.