https://github.com/renatodex/multipassify
Shopify Multipass module for Ruby
https://github.com/renatodex/multipassify
api integration multipass oauth ruby shopify
Last synced: about 1 year ago
JSON representation
Shopify Multipass module for Ruby
- Host: GitHub
- URL: https://github.com/renatodex/multipassify
- Owner: renatodex
- License: mit
- Created: 2017-07-20T20:30:05.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-20T23:21:34.000Z (almost 9 years ago)
- Last Synced: 2025-01-31T20:45:00.577Z (over 1 year ago)
- Topics: api, integration, multipass, oauth, ruby, shopify
- Language: Ruby
- Homepage:
- Size: 11.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README

# Multipassify
Shopify Multipass module for Ruby
[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
More details on Multipass with Shopify can be found [here](http://docs.shopify.com/api/tutorials/multipass-login).
## Installation
gem install multipassify
## Usage
To use Multipass an Enterprise / Plus plan is required. The Multipass secret can be found in your shop Admin (Settings > Checkout > Customer Accounts).
Make sure "Accounts are required" or "Accounts are optional" is selected and Multipass is enabled.
``` ruby
require 'multipassify'
# Construct the Multipassify encoder
multipassify = Multipassify.new 'SHOPIFY MULTIPASS SECRET'
# Create your customer data hash
customer_data = { email: 'test@example.com', remote_ip:'USERS IP ADDRESS', return_to:"http://some.url"}
# Encode a Multipass token
token = multipassify.encode(customer_data)
# Generate a Shopify multipass URL to your shop
url = multipassify.generate_url(customer_data, 'yourstorename.myshopify.com')
# Generates a URL like: https://yourstorename.myshopify.com/account/login/multipass/
```
## Information & Credits
This is a Ruby Port from [GitHub - beaucoo/multipassify: Shopify Multipass module for Node.js](https://github.com/beaucoo/multipassify).
Credits to @beaucoo and Shopify Multipass documentation!