Repository is archived
No release in over 3 years
Low commit activity in last 3 years
Parallel Markets OAuth strategy for OmniAuth.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 12.0
~> 3.5

Runtime

 Project Readme

Caution

This gem is no longer maintained. Please use the omniauth-oauth2 gem directly.

Gem Version Tests

OmniAuth ParallelMarkets

This gem contains the Parallel Markets strategy for OmniAuth.

ParallelMarkets uses the OAuth2 flow, you can read about at developer.parallelmarkets.com/api.

Installation

Add this line to your application's Gemfile:

gem 'omniauth-parallelmarkets'

And then execute:

$ bundle

Or install it yourself as:

$ gem install omniauth-parallelmarkets

Usage

You'll need to register your application with Parallel Markets Support and get client_id & client_secret.

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

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :parallelmarkets, ENV["CLIENT_ID"], ENV["CLIENT_SECRET"]
end

See the documentation for OmniAuth for more information on usage.

Sample Auth Hash

{
  "provider"=>"parallelmarkets",
  "uid"=>"VXNlcjox",
  "info"=> {
    "name"=>"Snake Plissken",
    "email"=>"snake@example.com",
    "first_name"=>"Snake"
    "last_name"=>"Plissken"
  },
  "credentials"=> {
    "token"=>"parallel_access_token",
    "refresh_token"=>"parallel_refresh_token",
    "expires_at"=>1451681914,
    "expires"=>true
  },
  "extra"=> {
    "type"=>"individual",
    "user_id"=>"VXNlcjox",
    "accreditations"=>[
      {
        "id"=>321,
        "status"=>"current",
        "expires_at"=>1565317542,
        "assertion_type"=>"income",
        "created_at"=>1565307542
      }
    ]
  }
}

License

The gem is available as open source under the terms of the MIT License.