atlas-node-multipass
OpenMRSID 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.
Installation
npm install atlas-node-multipass
Usage
Multipass is constructed with two arguments: an API key and a site key.
var Multipass = ;// Construct the Multipass encoder / decodervar multipass = 'API-KEY' 'SITE-KEY';// Encode a Multipass tokenvar token = multipass;// Decode a Multipass tokenvar obj = multipass;
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 Atlas.
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.
Copyright (c) 2012 David Wood bitprobe@gmail.com