omniauth-heroku-sso

omniauth-heroku-sso provides an OmniAuth strategy for Heroku's single-sign-on, which is part of the Heroku Provider Program.

Usage

Add it to your Gemfile:

gem 'omniauth-heroku-sso`

In a Rails app, add config/initializers/omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :heroku_sso, "HEROKU_SALT"
end

Or, in a Sinatra app:

use OmniAuth::Builder do
  provider :heroku_sso, "HEROKU_SALT"
end

post "/auth/heroku_sso/callback" do
  auth = request.env['omniauth.auth]
  # Use the auth info
end

Version History

1.0.3

  • Added "email" to the "info" portion of the auth hash. This is redundant with "name" but included to align with Heroku's POST params better.

1.0.2

  • Added "nav-data" to the "info" portion of the auth hash to allow handing off to Heroku::Nav::Provider.html without going outside the auth hash.

1.0.1

  • Added "name" field to the "info" portion of the auth hash. In Omniauth, this field is required. However, because Heroku only gives us an email address, that value is used here.
  • Added "token" field to the "credentials" portion of the auth hash. You don't need this in regular use, but it's provided for completeness and debugging.

1.0.0

  • Initial release.