akera-web-authentication

1.0.13 • Public • Published

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

Dependents (1)

Package Sidebar

Install

npm i akera-web-authentication

Homepage

akera.io

Weekly Downloads

2

Version

1.0.13

License

MIT

Unpacked Size

21.1 kB

Total Files

11

Last publish

Collaborators

  • akera-io
  • akeraio