Class SASLAuthentication


  • public final class SASLAuthentication
    extends java.lang.Object

    This class is responsible authenticating the user using SASL, binding the resource to the connection and establishing a session with the server.

    Once TLS has been negotiated (i.e. the connection has been secured) it is possible to register with the server or authenticate using SASL. If the server supports SASL then Smack will try to authenticate using SASL..

    The server may support many SASL mechanisms to use for authenticating. Out of the box Smack provides several SASL mechanisms, but it is possible to register new SASL Mechanisms. Use registerSASLMechanism(SASLMechanism) to register a new mechanisms.

    See Also:
    SASLMechanism
    • Method Detail

      • registerSASLMechanism

        public static void registerSASLMechanism​(SASLMechanism mechanism)
        Registers a new SASL mechanism.
        Parameters:
        mechanism - a SASLMechanism subclass.
      • getRegisterdSASLMechanisms

        public static java.util.Map<java.lang.String,​java.lang.String> getRegisterdSASLMechanisms()
        Returns the registered SASLMechanism sorted by the level of preference.
        Returns:
        the registered SASLMechanism sorted by the level of preference.
      • unregisterSASLMechanism

        public static boolean unregisterSASLMechanism​(java.lang.String clazz)
        Unregister a SASLMechanism by it's full class name. For example "org.jivesoftware.smack.sasl.javax.SASLCramMD5Mechanism".
        Parameters:
        clazz - the SASLMechanism class's name
        Returns:
        true if the given SASLMechanism was removed, false otherwise