Package org.jivesoftware.smack
Class SASLAuthentication
- java.lang.Object
-
- org.jivesoftware.smack.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
authenticationSuccessful()
static boolean
blacklistSASLMechanism(java.lang.String mechanism)
static java.util.Set<java.lang.String>
getBlacklistedSASLMechanisms()
static java.util.Map<java.lang.String,java.lang.String>
getRegisterdSASLMechanisms()
Returns the registered SASLMechanism sorted by the level of preference.static boolean
isSaslMechanismRegistered(java.lang.String saslMechanism)
static void
registerSASLMechanism(SASLMechanism mechanism)
Registers a new SASL mechanism.static boolean
unBlacklistSASLMechanism(java.lang.String mechanism)
static boolean
unregisterSASLMechanism(java.lang.String clazz)
Unregister a SASLMechanism by it's full class name.
-
-
-
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.
-
isSaslMechanismRegistered
public static boolean isSaslMechanismRegistered(java.lang.String saslMechanism)
-
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
-
blacklistSASLMechanism
public static boolean blacklistSASLMechanism(java.lang.String mechanism)
-
unBlacklistSASLMechanism
public static boolean unBlacklistSASLMechanism(java.lang.String mechanism)
-
getBlacklistedSASLMechanisms
public static java.util.Set<java.lang.String> getBlacklistedSASLMechanisms()
-
authenticationSuccessful
public boolean authenticationSuccessful()
-
-