masukomi/omniauth-dwolla masukomi/omniauth-dwolla


Dwolla OAuth2 Strategy for OmniAuth 1.0.

Host: GitHub

Language: Ruby


OmniAuth Dwolla

Gem Version Build Status Coverage Status Code Climate security

Dwolla OAuth2 Strategy for OmniAuth 1.0.

Installing

Add to your Gemfile:

gem 'omniauth-dwolla'

Then bundle install.

Usage

OmniAuth::Strategies::Dwolla is simply a Rack middleware. Read the OmniAuth 1.0 docs for detailed instructions: https://github.com/intridea/omniauth.

Here's a quick example, adding the middleware to a Rails app in config/initializers/omniauth.rb and getting a token with scope permissions for full user info, send and request transactions:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :dwolla, ENV['DWOLLA_KEY'], ENV['DWOLLA_SECRET'], 
  :scope                  => 'accountinfofull|send|request',
  :provider_ignores_state => true
end

The :scope param is optional.

The default :scope is 'accountinfofull'. It is necessary in order to grab the uid and detailed info for user.

The extra hash will include:

    "raw_info": {
        "City": "Des Moines",
        "Id": "812-111-1111",
        "Latitude": 41.584546,
        "Longitude": -93.634167,
        "Name": "Test User",
        "State": "IA",
        "Type": "Personal"
    }

Exception Handling

If the Dwolla library raises a Dwolla::RequestException, that will be wrapped and re-raised as a OmniAuth::Strategies::OAuth2::CallbackError. The OmniAuth OAuth2 library will, in turn, treat that as a failure due to invalid credentials, passing the CallbackError through Rack's middleware chain.

Note that the Devise::OmniauthCallbacksController provides a good example of handling this scenario.

Maintainer's Note

The omniauth-dwolla gem is currently maintained by masukomi (GitHub, web). PRs will be happily accepted but the tests must still pass (and be updated if necessary). We're dealing with money here folks. We can't be careless.

I'm @masukomi on Twitter and that's the best way to contact me if you have any questions or ideas about this gem. My GitHub notifications page is typically overflowing with stuff from work. ;)

Project Statistics

Sourcerank 4
Size 165 KB
Stars 19
Forks 11
Watchers 2
Open issues 2
Dependencies 8
Contributors 3
Tags 13
Created
Last updated
Last pushed

Top Contributors See all

masukomi (a.k.a. Kay Rhodes) Neeraj Singh Corey Innis

Projects Referencing this Repo

omniauth-dwolla
OmniAuth strategy for Dwolla.
Latest release 0.0.16 - Updated - 19 stars

Recent Tags See all

v0.0.14 May 26, 2013
v0.0.13 January 23, 2012
v0.0.12 January 22, 2012
v0.0.11 January 15, 2012
v0.0.10 January 15, 2012
v0.0.9 January 15, 2012
v0.0.8 January 15, 2012
v0.0.7 January 15, 2012
v0.0.6 January 15, 2012
v0.0.5 January 15, 2012
v0.0.4 January 15, 2012
v0.0.3 January 15, 2012
v0.0.2 January 14, 2012

Something wrong with this page? Make a suggestion

Last synced: 2016-05-27 16:43:26 UTC

Login to resync this repository