anm

atlas-node-multipass

Encode and Decode of multipass tokens for openmrs atlas authentication

Showing:

Popularity

Downloads/wk

3

GitHub Stars

2

Maintenance

Last Commit

5yrs ago

Contributors

2

Package

Dependencies

0

Size (min+gzip)

0.6KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

atlas-node-multipass

Build Status OpenMRS Talk OpenMRS IRC OpenMRS Telegram devDependencies Status devDependencies Status Downloads NPM version PRs Welcome

NPM

OpenMRS

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 = require('atlas-node-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 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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100