@xmpp/sasl
XMPP SASL for JavaScript
Last updated 6 months ago by sonny .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @xmpp/sasl 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.11.0                                ...           latest (6 months ago)

12 Versions

  • 0.11.0                                ...           6 months ago
  • 0.10.0                                ...           6 months ago
  • 0.9.2                                ...           7 months ago
  • 0.9.1                                ...           8 months ago
  • 0.9.0                                ...           9 months ago
  • 0.8.0                                ...           10 months ago
  • 0.7.4                                ...           a year ago
  • 0.7.0                                ...           2 years ago
  • 0.6.2                                ...           2 years ago
  • 0.6.0                                ...           2 years ago
  • 0.5.1                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 12
This Month 16
Last Day 5
Last Week 21
Last Month 102
Dependencies (4)
Dev Dependencies (0)
None
Dependents (2)

Copyright 2014 - 2016 © taobao.org |