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
    • Parameters

      • mechname: string = 'PLAIN'
      • isClientFirst: boolean = true
      • priority: number = 50

      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

      Returns string

      Mechanism response.

    • Protocol informs mechanism implementation about SASL failure.

      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

      Returns boolean

      If mechanism was able to run.