From fd7437b8435de4f34619ccd0f126cdb1c5efd17e Mon Sep 17 00:00:00 2001 From: Rob Kaufman Date: Thu, 15 Feb 2024 15:48:26 -0800 Subject: [PATCH] make sure you can see the metadata page even if saml is not yet configured --- config/initializers/devise.rb | 1 + lib/omni_auth/strategies/saml_decorator.rb | 2 ++ 2 files changed, 3 insertions(+) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 8c1307c2b..3f5420cf4 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -293,6 +293,7 @@ # setup for multiprovider SAML options dynamic_options_generator = lambda { |identity_provider_id, rack_env| identity_provider = IdentityProvider.find(identity_provider_id) + identity_provider.options = {} if identity_provider.options.blank? # Protect against nil or empty string identity_provider.parsed_options(rack_env) } identity_provider_id_regex = /\d+/ diff --git a/lib/omni_auth/strategies/saml_decorator.rb b/lib/omni_auth/strategies/saml_decorator.rb index f4f07ce93..31eb02191 100644 --- a/lib/omni_auth/strategies/saml_decorator.rb +++ b/lib/omni_auth/strategies/saml_decorator.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +# OVERRIDE OmniAuth v2.1.1 + # monkey patch to support metadata paths - hacked version of: # https://github.com/salsify/omniauth-multi-provider/issues/4#issuecomment-366452170 #