No commit activity in last 3 years
No release in over 3 years
Alipay OAuth2 Strategy for OmniAuth
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

omniauth-alipay-oauth2

Gem Version Dependency Status

Alipay OAuth2 Strategy for OmniAuth.

Support connecting Alipay account to third-party APP and website. Read the Alipay docs for more details: App支付宝登录, 网站支付宝登录

Installing

Add to your Gemfile:

gem 'omniauth-alipay-oauth2', require: 'omniauth-alipay'

Then bundle install.

Usage

Adding the middleware to a Rails app in config/initializers/omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :alipay, 'your_app_id', File.read('rsa_private_key.pem'), 'alipay_public_key'
end

Read the OmniAuth docs for detailed instructions: https://github.com/intridea/omniauth.

Sandbox

Developing in sandbox environment. See: 关于沙箱

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :alipay, 'your_app_id', File.read('rsa_private_key.pem'), 'alipay_public_key',
            client_options: {
              authorize_url: 'https://openauth.alipaydev.com/oauth2/publicAppAuthorize.htm',
              token_url: 'https://openauth.alipaydev.com/oauth2/token',
              url: 'https://openapi.alipaydev.com/gateway.do'
            }
end