0.01
No commit activity in last 3 years
No release in over 3 years
Strategy for authenticating to Shopify API with OmniAuth.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 1.0
 Project Readme

OmniAuth Shopify Strategy

Strategy for authenticating to Shopify API using OmniAuth.

Build Status

Installation

Add this line to your application's Gemfile:

gem 'omniauth-shopify'

Usage

First, you will need to register an application with Shopify and obtain an API key. Once you do that, you can use it like so:

use OmniAuth::Builder do
  provider :shopify, 'api_key', 'shared_secret'
end

Auth Hash Schema

The following information is provided back to you for this provider:

{
  uid: 'some-store',
  info: {
    name: 'some-store',
    urls: { site: 'https://some-store.myshopify.com/admin' }
  },
  credentials: { # basic auth
    username: 'api_key',
    password: 'password'
  }
}

Examples

examples/ directory contains few simple sinatra apps:

  • auth_hash.rb - displays auth hash schema
  • api_consumer.rb - consuming api with httparty

So, make sure you have sinatra and httparty gems and run it as follow:

SHOPIFY_KEY="apikey" SHOPIFY_SECRET="secret" ruby auth_hash.rb

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request