1.2.4 • Published 7 years ago

@lanetix/make-token v1.2.4

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

node-lanetix-make-token

Circle CI

Module to simplify interating with the auth service to get a token. Up to ~150MB of tokens are cached for slightly less than the time they take to expire (one day), at which point the least recently used are removed.

Installation

Ensure that you are are logged in as the lanetix npm user via npm login or use a .npmrc file with a token for the lanetix user.

npm install --save @lanetix/make-token

Usage

To use this library,

var makeToken = require('@lanetix/make-token')(
  'http://url.to.auth',
  'private....key....',
  'urn:issurer'
);


makeToken.forUser(1337) //user id
  .then(function (token) {
    //do stuff with token
  });

makeToken.forSystemUser(42) //org id
  .then(function (token) {
    //do stuff with token
  });

In order for auth to not 401, you'll need to register your service's public key here.

1.2.4

7 years ago

1.2.3

8 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago