alexkwolfe / node-multipass

Encode and decode Tender Multipass tokens

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

node-multipass Build Status

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.


    npm install multipass


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: '', name: 'test', expires: '2011-07-06 23:28:40Z' });

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


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.


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.


Encode and decode Tender Multipass tokens

License:MIT License


Language:JavaScript 98.8%Language:Makefile 1.2%