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

Development

~> 2.0
~> 10.0

Runtime

 Project Readme

OmniAuth Aliexpress

Aliexpress OAuth2 Strategy for OmniAuth

Installation

Add to your Gemfile:

gem 'omniauth-aliexpress-oauth2'

Then bundle install.

Usage

OmniAuth::Strategies::Aliexpress is simply a Rack middleware. Read the OmniAuth docs for detailed instructions.

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 :aliexpress, ENV['API_KEY'], ENV['APP_SECRET']
end

Authenticate the user by having them visit /auth/aliexpress. For example:

<a href="/auth/aliexpress">Authenticate</a>

Authentication Hash

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

{
  provider: 'aliexpress',
  credentials: {
    token: "token",
    refresh_token: "refresh token",
    expires_at: 1590227513,
    refresh_token_expires_at: 1590227513
  },
  info: {
    user_nick: "user nick",
    user_id: "user id",
    locale: "locale",
    sp: "sp"
  },
  extra: {
    w1_expires_at: 1590227513,
    w2_expires_at: 1590227513,
    r1_expires_at: 1590227513,
    r2_expires_at: 1590227513
  }
}

License

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