Constructor
new SASLMechanism()
PrivateConstructor: Strophe.SASLMechanism SASL auth mechanism abstraction.
Parameters: (String) name - SASL Mechanism name. (Boolean) isClientFirst - If client should send response first without challenge. (Number) priority - Priority.
Returns: A new Strophe.SASLMechanism object.
Members
isClientFirst
PrivateVariable: isClientFirst If client sends response without initial server challenge.
mechname
PrivateVariable: mechname Mechanism name.
priority
Variable: priority
Determines which
Example: (This will cause Strophe to choose the mechanism that the server sent first)
Strophe.SASLPlain.priority = Strophe.SASLSHA1.priority;
See
Methods
clientChallenge()
PrivateFunction: clientChallenge Called by the protocol implementation if the client is expected to send data first in the authentication exchange (i.e. isClientFirst === true).
Parameters: (Strophe.Connection) connection - Target Connection.
Returns: (String) Mechanism response.
onChallenge()
PrivateFunction: onChallenge Called by protocol implementation on incoming challenge.
By deafult, if the client is expected to send data first (isClientFirst === true),
this method is called with challenge
as null on the first call,
unless clientChallenge
is overridden in the relevant subclass.
Parameters: (Strophe.Connection) connection - Target Connection. (String) challenge - current challenge to handle.
Returns: (String) Mechanism response.
onFailure()
PrivateFunction: onFailure Protocol informs mechanism implementation about SASL failure.
onStart()
PrivateFunction: onStart Called before starting mechanism on some connection.
Parameters: (Strophe.Connection) connection - Target Connection.
onSuccess()
PrivateFunction: onSuccess Protocol informs mechanism implementation about SASL success.
test()
Function: test Checks if mechanism able to run. To disable a mechanism, make this return false;
To disable plain authentication run
Strophe.SASLPlain.test = function() { return false; }
See
Parameters: (Strophe.Connection) connection - Target Connection.
Returns: (Boolean) If mechanism was able to run.