|
Openfire 3.9.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.openfire.net.SASLAuthentication
public class SASLAuthentication
SASLAuthentication is responsible for returning the available SASL mechanisms to use and for actually performing the SASL authentication.
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 passwords
Nested Class Summary | |
---|---|
static class |
SASLAuthentication.ElementType
|
static class |
SASLAuthentication.Status
|
Field Summary | |
---|---|
protected static String |
CHARSET
The utf-8 charset for decoding and encoding Jabber packet streams. |
Constructor Summary | |
---|---|
SASLAuthentication()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static String CHARSET
Constructor Detail |
---|
public SASLAuthentication()
Method Detail |
---|
public static String getSASLMechanisms(LocalSession session)
session
- The current session
public static org.dom4j.Element getSASLMechanismsElement(Session session)
public static SASLAuthentication.Status handle(LocalSession session, org.dom4j.Element doc) throws UnsupportedEncodingException
session
- the session that is authenticating with the server.doc
- the stanza sent by the authenticating entity.
UnsupportedEncodingException
- If UTF-8 charset is not supported.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 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.
|
Openfire 3.9.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |