Use IDPMetadataParse to set up the Idp SAML settings
Co-authored-by: Anamika Aggarwal <anamikaagg18@gmail.com>
This commit is contained in:
committed by
Javi Martín
parent
6190d808ba
commit
5cb5f19e4f
@@ -286,11 +286,12 @@ Devise.setup do |config|
|
||||
Rails.application.secrets.wordpress_oauth2_secret,
|
||||
client_options: { site: Rails.application.secrets.wordpress_oauth2_site },
|
||||
setup: ->(env) { OmniauthTenantSetup.wordpress_oauth2(env) }
|
||||
config.omniauth :saml,
|
||||
sp_entity_id: Rails.application.secrets.saml_sp_entity_id,
|
||||
idp_cert: Rails.application.secrets.saml_idp_cert,
|
||||
idp_sso_service_url: Rails.application.secrets.saml_idp_sso_service_url,
|
||||
allowed_clock_drift: 1.minute
|
||||
idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new
|
||||
saml_settings = idp_metadata_parser.parse_remote_to_hash(Rails.application.secrets.saml_idp_metadata_url)
|
||||
saml_settings[:idp_sso_service_url] = Rails.application.secrets.saml_idp_sso_service_url
|
||||
saml_settings[:sp_entity_id] = Rails.application.secrets.saml_sp_entity_id
|
||||
saml_settings[:allowed_clock_drift] = 1.minute
|
||||
config.omniauth :saml, saml_settings
|
||||
|
||||
# ==> Warden configuration
|
||||
# If you want to use other strategies, that are not supported by Devise, or
|
||||
|
||||
@@ -92,7 +92,7 @@ staging:
|
||||
wordpress_oauth2_secret: ""
|
||||
wordpress_oauth2_site: ""
|
||||
saml_sp_entity_id: ""
|
||||
saml_idp_cert: ""
|
||||
saml_idp_metadata_url: ""
|
||||
saml_idp_sso_service_url: ""
|
||||
<<: *maps
|
||||
<<: *apis
|
||||
@@ -151,7 +151,7 @@ preproduction:
|
||||
wordpress_oauth2_secret: ""
|
||||
wordpress_oauth2_site: ""
|
||||
saml_sp_entity_id: ""
|
||||
saml_idp_cert: ""
|
||||
saml_idp_metadata_url: ""
|
||||
saml_idp_sso_service_url: ""
|
||||
<<: *maps
|
||||
<<: *apis
|
||||
@@ -209,7 +209,7 @@ production:
|
||||
wordpress_oauth2_secret: ""
|
||||
wordpress_oauth2_site: ""
|
||||
saml_sp_entity_id: ""
|
||||
saml_idp_cert: ""
|
||||
saml_idp_metadata_url: ""
|
||||
saml_idp_sso_service_url: ""
|
||||
<<: *maps
|
||||
<<: *apis
|
||||
|
||||
Reference in New Issue
Block a user