alexcusack / omniauth-coinbase

Coinbase OAuth 2 Strategy for Omniauth

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OmniAuth Coinbase

OmniAuth 2 strategy for Coinbase

For more details, read the Coinbase API Reference

Installation

Add to your Gemfile:

gem "omniauth-coinbase"

Then bundle install.

Usage

Here's an example, adding the middleware to a Rails app in config/initializers/omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :coinbase, ENV["COINBASE_KEY"], ENV["COINBASE_SECRET"]
end

You can now access the OmniAuth Coinbase OAuth2 URL: /auth/coinbase

Configuration

You can configure permissions/scope, which you pass in to the provider method after your COINBASE_KEY and COINBASE_SECRET:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :coinbase, ENV["COINBASE_KEY"], ENV["COINBASE_SECRET"], scope: 'user send addresses'
end

The format is a space separated list of strings from Coinbase's list of OAuth Permissions. If you don't include any scope it will default to all.

NOTE: While developing your application, if you change the scope in the initializer you will need to restart your app server. Remember that at minimum you MUST include either the 'all' or 'user' scopes.

About

Coinbase OAuth 2 Strategy for Omniauth

License:MIT License


Languages

Language:Ruby 100.0%