Socket
Socket
Sign inDemoInstall

@xmpp/sasl

Package Overview
Dependencies
6
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @xmpp/sasl

XMPP SASL for JavaScript


Version published
Maintainers
1
Install size
124 kB
Created

Readme

Source

SASL

SASL Negotiation for @xmpp/client.

Included and enabled in @xmpp/client.

Usage

object

const {xmpp} = require('@xmpp/client')
const client = xmpp({credentials: {
  username: 'foo',
  password: 'bar'
})

function

Instead, you can provide a function that will be called every time authentication occurs (every (re)connect).

Uses cases:

  • Have the user enter the password every time
  • Do not ask for password before connection is made
  • Debug authentication
  • Using a SASL mechanism with specific requirements
  • Perform an asynchronous operation to get credentials
const { xmpp } = require("@xmpp/client");
const client = xmpp({ credentials: authenticate });

async function authenticate(auth, mechanism) {
  console.debug("authenticate", mechanism);
  const credentials = {
    username: await prompt("enter username"),
    password: await prompt("enter password"),
  };
  console.debug("authenticating");
  try {
    await auth(credentials);
    console.debug("authenticated");
  } catch (err) {
    console.error(err);
    throw err;
  }
}

References

RFC 6120 SASL Negotiation

Keywords

FAQs

Last updated on 16 Feb 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc