0.1.3 • Published 5 years ago

ejabberd-auth v0.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

node-ejabberd-auth

A simple Node.js module you can use to build you own external ejabberd auth with

Installation

npm install ejabberd-auth

Usage

To create your own external authentication script for ejabberd, simply require ejabberd-auth and call the run() method exported by this module while passing your authentification function to it.

require('ejabberd-auth').run({
    actions: {
        auth: function(done, userName, domain, password) {
            // Some auth to be done here
            done(true); // or done(false) if the authentification has failed
        }
    }
});

run() takes a configuration object. It takes the following options:

  • log: Configuration for the Winston File transport used for logging (refer the winston documentation for more details). If no log configuration or filename is given, logging will be disabled.
  • actions: An object containing callback functions for the module to call, when ejabberd requests an action. Possible keys are:
    • auth: Called, when a user tries to log in. Call the callback with true to allow the user to enter. auth: function(callback, userName, domainName, password)
    • isuser: Called, when ejabberd needs to check, if a JID exists. isuser: function(callback, userName)
    • setpass: Called, when a user tries to change his password. Change the password and call the callback with true, to signalize, that the password was successfully changed. setpass: function(callback)

If any of the action key is not given, false will be returned to ejabberd.

0.1.3

5 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago