akera-web-authentication
Authentication middleware for Akera web service
Last updated 3 months ago by akeraio .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install akera-web-authentication 
SYNC missed versions from official npm registry.

Akera Logo

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 authenticated

  • successRedirect: the page where user will get redirected when authenticated

  • failureRedirect: the page where user will get redirected when authentication failed

  • providers: an array of authentication providers, supported providers:

    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

Current Tags

  • 1.0.13                                ...           latest (3 months ago)

7 Versions

  • 1.0.13                                ...           3 months ago
  • 1.0.10                                ...           4 years ago
  • 1.0.9                                ...           4 years ago
  • 1.0.8                                ...           4 years ago
  • 1.0.7                                ...           4 years ago
  • 1.0.6                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (2)
Dependents (3)

Copyright 2014 - 2016 © taobao.org |