The reason we have forked this is to allow for ignoring provider state if we are directly linking into the classlink omniauth callback route. THis method is modeled after the omniauth-clever gem. Without the ignore provider state option and handling links from the classlink portal will always fail with a csrf error.
Unofficial OmniAuth strategy for ClassLink integration.
Add the gem to your application's Gemfile:
gem 'omniauth-classlink'
And then execute:
$ bundle
First, you need to have your OAuth2 application registered in ClassLink. After creating one, you'll be provided with access key and secret that should be used for configuring the gem.
Rails.application.config.middleware.use OmniAuth::Builder do
provider :class_link, 'your-classlink-access-key', 'your-classlink-secret', strategy_class: 'OmniAuth::Strategies::ClassLink'
end
Or, alternatively, if you use Devise, you can put this in the Devise.setup
section:
config.omniauth :class_link,
'your-classlink-access-key',
'your-classlink-secret',
strategy_class: 'OmniAuth::Strategies::ClassLink'
- Fork it
- 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 new Pull Request
Apache 2.0