Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lanetix/make-token

Package Overview
Dependencies
Maintainers
30
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lanetix/make-token

make a jwt given an org or a user

  • 1.2.4
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
30
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 01 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc