├── .npmignore ├── .gitignore ├── package.json ├── README.md └── multipassify.js /.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | 10 | pids 11 | logs 12 | results 13 | 14 | npm-debug.log 15 | node_modules 16 | .idea 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "multipassify", 3 | "version": "1.0.2", 4 | "description": "Shopify Multipass module for Node.js", 5 | "homepage": "https://github.com/beaucoo/multipassify", 6 | "main": "./multipassify.js", 7 | "keywords": [ 8 | "shopify", 9 | "multipass" 10 | ], 11 | "engines": [ 12 | "node" 13 | ], 14 | "authors": [ 15 | "Cory Smith, @Smixx" 16 | ], 17 | "contributors": [ 18 | { 19 | "name": "BeauCoo", 20 | "email": "info@beaucoo.com", 21 | "url": "http://beaucoo.com/" 22 | }, 23 | { 24 | "name": "Cory Smith", 25 | "email": "cory@beaucoo.com" 26 | } 27 | ], 28 | "bugs": { 29 | "url": "https://github.com/beaucoo/multipassify/issues" 30 | }, 31 | "repository": { 32 | "type": "git", 33 | "url": "https://github.com/beaucoo/multipassify.git" 34 | }, 35 | "dependencies": { 36 | "crypto": "0.0.3" 37 | }, 38 | "readme": "", 39 | "readmeFilename": "README.md", 40 | "_id": "multipassify@1.0.0", 41 | "_from": "multipassify@1.0.0" 42 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | multipassify 2 | ============ 3 | 4 | Shopify Multipass module for Node.js 5 | 6 | 7 | 8 | [Shopify](http://shopify.com) provides a mechanism for single sign-on known as Multipass. Multipass uses an AES encrypted JSON hash and multipassify provides functions for generating tokens 9 | 10 | More details on Multipass with Shopify can be found [here](http://docs.shopify.com/api/tutorials/multipass-login). 11 | 12 | ## Installation 13 |
14 | npm install multipassify 15 |16 | 17 | ## Usage 18 | 19 | To use Multipass an Enterprise / Plus plan is required. The Multipass secret can be found in your shop Admin (Settings > Checkout > Customer Accounts). 20 | Make sure "Accounts are required" or "Accounts are optional" is selected and Multipass is enabled. 21 | 22 | ``` js 23 | var Multipassify = require('multipassify'); 24 | 25 | // Construct the Multipassify encoder 26 | var multipassify = new Multipassify("SHOPIFY MULTIPASS SECRET"); 27 | 28 | // Create your customer data hash 29 | var customerData = { email: 'test@example.com', remote_ip:'USERS IP ADDRESS', return_to:"http://some.url"}; 30 | 31 | // Encode a Multipass token 32 | var token = multipassify.encode(customerData); 33 | 34 | // Generate a Shopify multipass URL to your shop 35 | var url = multipassify.generateUrl(customerData, "yourstorename.myshopify.com"); 36 | 37 | // Generates a URL like: https://yourstorename.myshopify.com/account/login/multipass/