OmniAuth strategy for authenticating against Mariana Tek using OAuth 2.
Add this line to your application's Gemfile:
gem 'omniauth-marianatek'
And then execute:
$ bundle
Or install it yourself as:
$ gem install omniauth-marianatek
Integrate the strategy into your middleware.
# config/initializers/omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
provider :marianatek, ENV['MARIANA_TEK_CLIENT_ID'], ENV['MARIANA_TEK_CLIENT_SECRET']
end
The route /auth/marianatek
will become available to initiate authentication.
Set up the callback route /auth/marianatek/callback
and tie to a controller action
to handle any post-authentication actions.
# config/routes.rb
Rails.application.routes.draw do
get '/auth/marianatek/callback', to: 'sample_controller#marianatek'
end
The gem is available as open source under the terms of the MIT License.