OmniAuth strategy for authenticating to OpenAM.
Add to your Gemfile
:
gem 'omniauth-openam'
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
Here's an example Auth Hash available in request.env['omniauth.auth']
:
{
provider: "openam",
uid: "bjensen",
info: {
email: "bjensen@example.com",
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: ["bjensen@example.com"],
objectclass: ["organizationalPerson", "person", "inetOrgPerson", "top"],
sn: ["Jensen"],
telephonenumber: ["+1 408 555 1862"],
uid: ["bjensen"]
}
}
}