0.0
No commit activity in last 3 years
No release in over 3 years
Ruby port of npm package Multipassify
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 2.1.0
~> 3.12
 Project Readme

Multipassify

Multipassify

Shopify Multipass module for Ruby

Shopify 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.

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.

  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/<MULTIPASS-TOKEN>

Information & Credits

This is a Ruby Port from GitHub - beaucoo/multipassify: Shopify Multipass module for Node.js. Credits to @beaucoo and Shopify Multipass documentation!