mancausoft / shopify-multipass

Shopify Multipass module for Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shopify-multipass

Shopify Multipass module for Python

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

$ pip install shopify-multipass

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.

# Construct the Multipassify encoder
from multipass import Multipass

multipass = Multipass('SHOPIFY MULTIPASS SECRET');

# Create your customer data hash
customerData = {'email': 'test@example.com', 'return_to': 'http://some.url'};

# Generate a Shopify multipass URL to your shop
url = multipass.generateURL(customerData, 'yourstorename.myshopify.com');

# Generates a URL like:  https://yourstorename.myshopify.com/account/login/multipass/<MULTIPASS-TOKEN>

References

multipassify

About

Shopify Multipass module for Python

License:Apache License 2.0


Languages

Language:Python 100.0%