Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

How to authenticate a Shopify app using OAuth2

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 config
Octocat-spinner-32 db
Octocat-spinner-32 doc
Octocat-spinner-32 lib
Octocat-spinner-32 log
Octocat-spinner-32 public
Octocat-spinner-32 script
Octocat-spinner-32 vendor
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README.markdown
Octocat-spinner-32 Rakefile

Shopify OAuth2 Example

This is an example of how to use OAuth2 authentication in a Shopify app.


First create a new Shopify app from your Shopify Partner dashboard, and copy the api key and shared secret.

Then run the following commands in a terminal:

$ git clone git://
$ cd shopify-oauth2-example
$ bundle
$ rake db:migrate
$ export SHOPIFY_API_KEY=[paste your app's shopify api key here]
$ export SHOPIFY_SHARED_SECRET=[paste your app's shared secret here]
$ rails s

Then point your browser to localhost:3000, and sign in with a test shop.

Something went wrong with that request. Please try again.