Package org.jivesoftware.smack
Class SASLAuthentication
java.lang.Object
org.jivesoftware.smack.SASLAuthentication
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:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static boolean
blacklistSASLMechanism
(String mechanism) Returns the registered SASLMechanism sorted by the level of preference.static boolean
isSaslMechanismRegistered
(String saslMechanism) static void
registerSASLMechanism
(SASLMechanism mechanism) Registers a new SASL mechanism.static boolean
unBlacklistSASLMechanism
(String mechanism) static boolean
unregisterSASLMechanism
(String clazz) Unregister a SASLMechanism by it's full class name.
-
Method Details
-
registerSASLMechanism
Registers a new SASL mechanism.- Parameters:
mechanism
- a SASLMechanism subclass.
-
getRegisterdSASLMechanisms
Returns the registered SASLMechanism sorted by the level of preference.- Returns:
- the registered SASLMechanism sorted by the level of preference.
-
isSaslMechanismRegistered
-
unregisterSASLMechanism
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
-
blacklistSASLMechanism
-
unBlacklistSASLMechanism
-
getBlacklistedSASLMechanisms
-
authenticationSuccessful
-