OmniAuth

suggest change

Pick a strategy and add it to the Gemfile. The strategy list is in the OmniAuth wiki.

gem "omniauth-github"
gem "omniauth-openid"

OmniAuth 2 starts authentication only on POST, and a Rails app needs request forgery protection on that route (omniauth-rails_csrf_protection, or the OmniAuth 2 middleware options). A GET link to /auth/:provider will fail on OmniAuth 2.

Register the strategies as middleware:

Rails.application.config.middleware.use OmniAuth::Builder do
  require "openid/store/filesystem"
  provider :github, ENV["GITHUB_KEY"], ENV["GITHUB_SECRET"]
  provider :openid, store: OpenID::Store::Filesystem.new("/tmp")
end

By default, OmniAuth adds /auth/:provider. Start the flow from those paths.

On failure, OmniAuth redirects to /auth/failure.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents