public class SASLAuthentication extends Object
The list of available SASL mechanisms is determined by:
UserProvider
being used since
some SASL mechanisms require the server to be able to retrieve user passwordsModifier and Type | Class and Description |
---|---|
static class |
SASLAuthentication.ElementType |
static class |
SASLAuthentication.Status |
Constructor and Description |
---|
SASLAuthentication() |
Modifier and Type | Method and Description |
---|---|
static void |
addSupportedMechanism(String mechanism)
Adds a new SASL mechanism to the list of supported SASL mechanisms by the server.
|
static boolean |
authenticateSharedSecret(String digest)
Returns true if the supplied digest matches the shared secret value.
|
static String |
getSASLMechanisms(LocalSession session)
Returns a string with the valid SASL mechanisms available for the specified session.
|
static org.dom4j.Element |
getSASLMechanismsElement(Session session) |
static String |
getSharedSecret()
Returns the shared secret value, or null if shared secret authentication is
disabled.
|
static Set<String> |
getSupportedMechanisms()
Returns the list of supported SASL mechanisms by the server.
|
static SASLAuthentication.Status |
handle(LocalSession session,
org.dom4j.Element doc)
Handles the SASL authentication packet.
|
static boolean |
isSharedSecretAllowed()
Returns true if shared secret authentication is enabled.
|
static void |
removeSupportedMechanism(String mechanism)
Removes a SASL mechanism from the list of supported SASL mechanisms by the server.
|
static void |
setSharedSecretAllowed(boolean sharedSecretAllowed)
Sets whether shared secret authentication is enabled.
|
static boolean |
verifyCertificate(X509Certificate trustedCert,
String hostname) |
static boolean |
verifyCertificates(Certificate[] chain,
String hostname,
boolean isS2S) |
public static String getSASLMechanisms(LocalSession session)
session
- The current sessionpublic static org.dom4j.Element getSASLMechanismsElement(Session session)
public static SASLAuthentication.Status handle(LocalSession session, org.dom4j.Element doc)
session
- the session that is authenticating with the server.doc
- the stanza sent by the authenticating entity.public static boolean isSharedSecretAllowed()
public static void setSharedSecretAllowed(boolean sharedSecretAllowed)
sharedSecretAllowed
- true if shared secret authentication should be enabled.public static String getSharedSecret()
public static boolean authenticateSharedSecret(String digest)
digest
- the MD5 hash of the secret key, encoded as hex.public static boolean verifyCertificate(X509Certificate trustedCert, String hostname)
public static boolean verifyCertificates(Certificate[] chain, String hostname, boolean isS2S)
public static void addSupportedMechanism(String mechanism)
Note: this method simply registers the SASL mechanism to be advertised as a supported mechanism by Openfire. Actual SASL handling is done by Java itself, so you must add the provider to Java.
mechanism
- the new SASL mechanism.public static void removeSupportedMechanism(String mechanism)
mechanism
- the SASL mechanism to remove.public static Set<String> getSupportedMechanisms()
addSupportedMechanism(String)
to add
new SASL mechanisms.Copyright © 2003-2008 Jive Software.