OmniAuth strategy for 3dcart OAuth2
Authorization Code Flow https://apirest.3dcart.com/v2/getting-started/index.html#getting-started
You must first register your application: http://devportal.3dcart.com/
When you register the application, you will get an 'Client ID' and 'Client Secret'. These need to be provided when you configure the strategy (this example assumes the values are available in environment variables):
Rails.application.config.middleware.use OmniAuth::Builder do
provider :g3dcart, ENV['CLIENT_ID'], ENV['CLIENT_SECRET']
end
Add this line to your application's Gemfile:
gem 'omniauth-g3dcart'
And then execute:
$ bundle
Or install it yourself as:
$ gem install omniauth-g3dcart
Expected from 3dcart:
{
"token":"secret_secretihaveasecret",
"expires":"false"
}
- Fork it ( https://github.com/dropstream/omniauth-g3dcart/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request