Smile OAuth2 Strategy for OmniAuth 1.0.
Add to your Gemfile
:
gem 'omniauth-smile'
Then bundle install
.
OmniAuth::Strategies::Smile
is simply a Rack middleware. Read the OmniAuth 1.0 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 :smile, ENV['SMILE_CLIENT_ID'], ENV['SMILE_CLIENT_SECRET']
end
You can configure the scope, which you pass in to the provider
method via a Hash
:
scope
: A comma-separated list of permissions you want to request from the user.
Rails.application.config.middleware.use OmniAuth::Builder do
provider :smile, ENV['SMILE_CLIENT_ID'], ENV['SMILE_CLIENT_SECRET'], scope: 'customer:read'
end