OmniAuth OpenAM

Continuous Integration status

OmniAuth strategy for authenticating to OpenAM.

Installation

Add to your Gemfile:

gem 'omniauth-openam'

Usage

Here's a quick example, adding the middleware to a Rails app in config/initializers/omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :openam, 'https://example.com/opensso'
end

Auth Hash

Here's an example Auth Hash available in request.env['omniauth.auth']:

{
  provider: "openam",
  uid: "bjensen",
  info: {
    email: "[email protected]",
    first_name: "Barbara",
    last_name: "Jensen",
    name: "Babs Jensen",
    username: "bjensen",
  },
  credentials: {
    token: "AQIC5wM2LY4SfcxuxIP0VnP2lVjs7ypEM6VDx6srk56CN1Q.*AAJTSQACMDE.*"
  },
  extra: {
    raw_info: {
      token: "AQIC5wM2LY4SfcxuxIP0VnP2lVjs7ypEM6VDx6srk56CN1Q.*AAJTSQACMDE.*",
      cn: ["Babs Jensen", "Barbara Jensen"],
      dn: ["uid=bjensen,ou=people,dc=example,dc=com"],
      givenname: ["Barbara"],
      mail: ["[email protected]"],
      objectclass: ["organizationalPerson", "person", "inetOrgPerson", "top"],
      sn: ["Jensen"],
      telephonenumber: ["+1 408 555 1862"],
      uid: ["bjensen"]
    }
  }
}