This is an OmniAuth strategy for authenticating with Shopline using OAuth2.
Add this line to your application's Gemfile:
gem 'omniauth-shopline'And then execute:
$ bundle
Or install it yourself as:
$ gem install omniauth-shopline
Add the strategy to your Gemfile alongside OmniAuth:
gem 'omniauth'
gem 'omniauth-shopline'Then integrate the strategy into your middleware:
use OmniAuth::Builder do
provider :shopline, 'your_app_key', 'your_app_secret', {
handle: 'your_shopline_handle',
scope: 'read_products,read_orders'
}
endhandle: Your Shopline store handle (required)scope: Comma-separated list of permissions (optional, defaults to 'read_products')
The auth hash will contain:
{
provider: 'shopline',
uid: 'user_id',
info: {},
credentials: {
token: 'access_token',
expires_at: '2023-11-10T16:37:48.178+00:00',
scope: 'read_products,read_orders'
},
extra: {
handle: 'your_shopline_handle',
scope: 'read_products,read_orders'
}
}The gem is available as open source under the terms of the MIT License.