# multipass

> Encode and decode Tender Multipass tokens

Latest version **1.0.2** (published 2012-01-08) · 0 weekly downloads

## Install

```sh
npm install multipass
pnpm add multipass
yarn add multipass
bun add multipass
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2012-01-08 |
| First published | 2012-01-08 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | David Wood |
| Maintainers | davidwood |
| Keywords | sso, tender, multipass |

## Links

- npm: https://www.npmjs.com/package/multipass
- Repository: https://github.com/davidwood/node-multipass
- npm.io page: https://npm.io/package/multipass

## Recent versions

- 1.0.2 (latest) — 2012-01-08
- 1.0.1 — 2012-01-08
- 1.0.0 — 2012-01-08

## README

# Encode and decode Tender Multipass tokens

[Tender](http://tenderapp.com) 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](https://help.tenderapp.com/kb/setup-installation/share-your-own-sites-authentication-with-tender).

## Installation
<pre>
    npm install multipass
</pre>

## 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).

``` js
  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](https://help.tenderapp.com/kb/setup-installation/share-your-own-sites-authentication-with-tender).

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.

---
_Source: https://npm.io/package/multipass · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
