sasl-plain
Version:
JavaScript implementation of PLAIN SASL mechanism.
81 lines (45 loc) • 1.73 kB
Markdown
This module is a JavaScript implementation of the PLAIN SASL mechanism, which
plugs into the [SASL](https://github.com/jaredhanson/js-sasl) framework.
$ npm install sasl-plain
$ volo add jaredhanson/js-sasl-plain sasl-plain
For more information on using volo to manage JavaScript modules, visit [http://volojs.org/](http://volojs.org/).
Register the PLAIN mechanism.
```javascript
factory.use(require('sasl-plain'));
```
Send an authentication response with necessary credentials.
```
var mech = factory.create(['PLAIN']);
var resp = mech.response({ username: 'johndoe', password: 'secret' });
```
This module is [AMD](https://github.com/amdjs/amdjs-api)-compliant, and can be
loaded by module loaders such as [RequireJS](http://requirejs.org/).
This module is optimized for use with [Anchor](https://github.com/anchorjs/anchor).
This module is compatible with [Node](http://nodejs.org/).
To run tests in a browser, execute the Make target for the desired browser:
$ make test-chrome
$ make test-firefox
$ make test-safari
To run headless tests from a terminal using [PhantomJS](http://phantomjs.org/):
$ make test-phantomjs
To run tests in Node:
$ make test-node
[](http://travis-ci.org/jaredhanson/js-sasl-plain)
- [Jared Hanson](http://github.com/jaredhanson)
[](http://opensource.org/licenses/MIT)
Copyright (c) 2012 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>