Strophe.js
    Preparing search index...

    Class default

    Encapsulates an SASL authentication mechanism.

    User code may override the priority for each mechanism or disable it completely. See for information about changing priority and for informatian on how to disable a mechanism.

    By default, all mechanisms are enabled and t_he priorities are

    SCRAM-SHA-512 - 72
    SCRAM-SHA-384 - 71
    SCRAM-SHA-256 - 70
    SCRAM-SHA-1   - 60
    PLAIN         - 50
    OAUTHBEARER   - 40
    X-OAUTH2      - 30
    ANONYMOUS     - 20
    EXTERNAL      - 10
    

    See: Strophe.Connection#registerSASLMechanisms

    Hierarchy (View Summary)

    Index
    • PrivateConstructor: Strophe.SASLMechanism SASL auth mechanism abstraction.

      Parameters

      • name: string

        SASL Mechanism name.

      • isClientFirst: boolean

        If client should send response first without challenge.

      • priority: number

        Priority.

      Returns default

    _connection: default
    isClientFirst: boolean
    mechname: string
    priority: number
    • Called by the protocol implementation if the client is expected to send data first in the authentication exchange (i.e. isClientFirst === true).

      Parameters

      • connection: default

        Target Connection.

      Returns string | Promise<string | false>

      Mechanism response.

    • 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

      • _connection: default

        Target Connection.

      • Optional_challenge: string

        current challenge to handle.

      Returns string | Promise<string | false>

      Mechanism response.

    • Protocol informs mechanism implementation about SASL failure.

      Returns void

    • Called before starting mechanism on some connection.

      Parameters

      • connection: default

        Target Connection.

      Returns void

    • Protocol informs mechanism implementation about SASL success.

      Returns void

    • 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 for a list of available mechanisms.

      Parameters

      • _connection: default

        Target Connection.

      Returns boolean

      If mechanism was able to run.