Skip to content

Commit 6195f3c

Browse files
gluxonjhanggi
authored andcommitted
Add settings override for default ruby-saml params (#1434)
The University of Connecticut Shibboleth server prefers the HTTP Redirect SAML binding for sign-in. Changing this required overriding the idp_sso_target_url SAML setting passed to ruby-saml.
1 parent d048253 commit 6195f3c

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

config/settings.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ paperclip:
145145
# saml:
146146
# idp_metadata: "https://websso.example.com/idp/metadata"
147147
# # certificate_file: path/to/file.p12 # Optional. Do not check in to version control.
148+
# # driver: # Optional. Useful to override inferred SAML settings if need be.
149+
# # "idp_sso_target_url": "https://websso.example.com/idp/profile/SAML2/Redirect/SSO"
148150
# attribute_map:
149151
# "PersonImmutableID": "username"
150152
# "User.email": "email"

vendor/engines/saml_authentication/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ saml:
3232
* `attribute_map`: A mapping from the IdP's attributes to the NUcore's `users` table
3333
columns. `username` and `email` are absolutely required while entries for `first_name`
3434
and `last_name` are recommended.
35+
* `driver`: An optional mapping of settings to pass to the underlying ruby-saml
36+
gem. See *What Needs to be Configured* at https://developers.onelogin.com/saml/ruby
37+
for a list of valid keys. This useful if the default inferred SAML settings
38+
need to be overrided.
3539
3640
## Handling Users
3741

vendor/engines/saml_authentication/lib/saml_authentication/devise_configurator.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ def configure!
1919
config.saml_configure do |settings|
2020
settings.assertion_consumer_service_url = Rails.application.routes.url_helpers.auth_saml_user_session_url
2121
settings.issuer = Rails.application.routes.url_helpers.metadata_saml_user_session_url
22+
Hash(Settings.saml.driver).each do |key, value|
23+
settings.public_send("#{key}=", value)
24+
end
2225

2326
configure_security(settings)
2427
end

0 commit comments

Comments
 (0)