This package has been deprecated

Author message:

this package has been deprecated

token-auth-framework

1.0.8 • Public • Published

token-auth-framework

This framework simlifies integration with the authorization framework, which is combined with the session config. After cloning the repository, please run the following command on the command line, in order to install the required node packages:

npm install

Integration

Create the configuration object with following fields.

const TOKEN_AUTH_CONFIG = {
  "realm": <auth_server_realm_of_the_application>,
  "auth-server":  <auth_server_url>, 
  "client-id": <application client_id>,
  "client-secret": <application client_secret>,
  "session-name": <session_name>,
  "session-secret": <session_secret>
}

Afterwards, all is necessary to pass Express application context and the config above.

const TokenAuthController = require("token-auth-framework")

...

const tokenAuth = new TokenAuthController()
tokenAuth.initialize(app, TOKEN_AUTH_CONFIG)

Behaviour

If the user is not authorized, will redirected to the authorization server. Logout path is "/logout" To fetch the role info of the user use: "req.user.role".

Readme

Keywords

Package Sidebar

Install

npm i token-auth-framework

Weekly Downloads

1

Version

1.0.8

License

ISC

Unpacked Size

4.82 kB

Total Files

5

Last publish

Collaborators

  • tokeninccorp