Socket
Socket
Sign inDemoInstall

multipass

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    multipass

Encode and decode Tender Multipass tokens


Version published
Weekly downloads
101
increased by10000%
Maintainers
1
Install size
8.18 kB
Created
Weekly downloads
 

Readme

Source

Encode and decode Tender Multipass tokens

Tender provides a mechanism for single sign-on known as Multipass. Multipass uses an AES encrypted JSON hash and node-multipass provides functions for encoding and decoding these tokens.

More details on Multipass can be found here.

Installation

    npm install multipass

Usage

Multipass is constructed with two arguments: an API key and a site key. These keys can be found within the Tender admin (Accounts & Settings > Extras > Single Sign-On).

  var Multipass = require('multipass');

  // Construct the Multipass encoder / decoder
  var multipass = new Multipass('API-KEY', 'SITE-KEY');

  // Encode a Multipass token
  var token = multipass.encode({ email: 'test@example.com', name: 'test', expires: '2011-07-06 23:28:40Z' });

  // Decode a Multipass token
  var obj = multipass.decode(token);

encode(obj)

This function encodes the required obj argument. This argument is a JavaScript object and contains the data that you want to pass to Tender. A list of expected keys can be found here.

This function will return a string. If an error occurs, the undefined will be returned.

decode(token)

This function decodes the required token argument. This argument is an encoded Multipass token and a JavaScript object is returned. If decoding is not successful, undefined is returned.

Keywords

FAQs

Last updated on 08 Jan 2012

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc