passport-akera
Passport authentication strategy against Akera.io application server. This module is a Passport strategy wrapper for akera-api
Install
npm install passport-akera
Usage
Configure strategy
var AkeraStrategy = Strategy; passport;
-
server
: Akera.io settings. These are passed directly to akera-api connect method. See its documentation for all available options.host
: Akera.io application server host name or ip address, e.g.localhost
port
: Akera.io application server port number, e.g.cn='root'
useSSL
: Akera.io application server SSL connection flag
-
usernameField
: Field name where the user name is found, defaults to username -
passwordField
: Field name where the password is found, defaults to password -
passReqToCallback
: Whentrue
,req
is the first argument to the verify callback (default:false
):passport.use(new LdapStrategy(..., function(req, user, done) { ... done(null, user); } ));
Note: you can pass a function instead of an object as options
, see the example below
Authenticate requests
Use passport.authenticate()
, specifying the 'akeraAuth'
strategy, to authenticate requests.
authenticate()
options
In addition to default authentication options the following flash message options are available for passport.authenticate()
:
badRequestMessage
: missing username/password (default: 'Missing credentials')invalidCredentials
:InvalidCredentialsError
(default: error returned by akera-api connect)
Express example
var express = passport = bodyParser = AkeraStrategy = Strategy; var OPTS = server: host: 'localhost' port: '8383' useSSL: true ; var app = ; passport; app;app;app; app; app;
License
MIT