akera-web-authentication
v1.0.13
Published
Authentication middleware for Akera web service
Downloads
8
Readme
Authentication module for Akera.io web service.
Installation
$ npm install akera-web-authentication
Docs
Tests
To run the test suite, first install the dependencies, then run npm test
:
$ npm install
$ npm test
Quick Start
This module is designed to be loaded as application level service which
is usually done by adding a reference to it in services
section of
application's configuration.
"services": [
{
"middleware": "akera-web-authentication",
"config": {
"route": "/authenticate/",
"loginRedirect": "/login.html",
"successRedirect": "/",
"failureRedirect": "/autherr.html",
"providers": [
{
"strategy": "ldap",
"url": "ldap://localhost:389",
"bindDn": "ldapUser",
"bindCredentials": "passwd",
"searchBase": "CN=Users,DC=yourdomain,DC=com"
},
{
"strategy": "akera",
"route": "/server/",
"host": "localhost",
"port": 8383
}
]
}
}
]
Service options available:
route
: the route where the service is going to be mounted (default: '/auth/')loginRedirect
: the login page where user will get redirected if session not authenticatedsuccessRedirect
: the page where user will get redirected when authenticatedfailureRedirect
: the page where user will get redirected when authentication failedproviders
: an array of authentication providers, supported providers:ldap
: LDAP, Active Directory provider using passport-ldapauthoauth
: Generic OAuth provider that can work with any OAuth Passport providers like: passport-google-oauth, passport-facebook, passport-okta-oauthakera
: Akera.io server-side authentication provider using passport-akera
OAuth provider requires the specific provider package to be specified using
oauthStrategy
configuration property.OAuth provider specific configuration can be found on each provider web page, the
callbackURL
doesn't need to be set as it is overriden by the OAuth provider.{ "name": "facebook", "strategy": "oauth", "oauthStrategy": "passport-facebook", "clientID": "ID", "clientSecret": "secret" }, { "name": "google", "strategy": "oauth", "oauthStrategy": "passport-google-oauth", "clientID": "ID", "clientSecret": "secret" }, { "name": "okta", "strategy": "oauth", "oauthStrategy": "passport-okta-oauth", "clientID": "ID", "clientSecret": "secret", "scope": ["openid", "email", "profile"], "response_type": "code" }
License
MIT