Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

omniauth-yhd-oauth2

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

omniauth-yhd-oauth2

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

OmniAuth Yhd OAuth2

Yhd OAuth2 Strategy for OmniAuth 1.0.

Read Yhd OAuth2 docs for more details: http://open.yhd.com/opendoc.do

Installing

Add to your Gemfile:

gem 'omniauth-yhd-oauth2'

Then bundle install.

Or install it yourself as:

$ gem install omniauth-yhd-oauth2

Usage

OmniAuth::Strategies::Yhd 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:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :yhd, ENV['YHD_KEY'], ENV['YHD_SECRET']
end

Authentication Hash

Here's an example Authentication Hash available in request.env['omniauth.auth']:

{
       "provider" => "yhd",
            "uid" => xxxxx,
           "info" => {
        "nickname" => "xxxxx旗舰店"
    },
    "credentials" => {
             "token" => "f841875xxxxxxxxx81509d",
        "expires_at" => xxxxxxxxx,
           "expires" => true
    },
          "extra" => {
        "raw_info" => {
                      "storeId" => xxxxxxxxx,
                    "storeName" => "xxxxxxxx旗舰店",
                 "storeAddress" => "http://shop.yhd.com/html/xxxxx",
                "storeOpenTime" => "2xxx-xx-03 17:xx:13",
            "storeCategoryCode" => xxx,
                "storeNickName" => ""
        }
    }
}

PS. Built and tested on MRI Ruby 1.9.3

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

FAQs

Package last updated on 27 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc