Class: RackEntraIdAuth::Configuration

Inherits:
Object
  • Object
show all
Includes:
ActiveSupport::Configurable
Defined in:
lib/rack_entra_id_auth/configuration.rb

Constant Summary collapse

RUBY_SAML_SETTINGS =
%i(
  idp_entity_id
  idp_sso_service_url
  idp_slo_service_url
  idp_slo_response_service_url
  idp_cert
  idp_cert_fingerprint
  idp_cert_fingerprint_algorithm
  idp_cert_multi
  idp_attribute_names
  idp_name_qualifier
  valid_until
  sp_entity_id
  assertion_consumer_service_url
  single_logout_service_url
  sp_name_qualifier
  name_identifier_format
  name_identifier_value
  name_identifier_value_requested
  sessionindex
  compress_request
  compress_response
  double_quote_xml_attribute_values
  message_max_bytesize
  passive
  attributes_index
  force_authn
  certificate
  private_key
  sp_cert_multi
  authn_context
  authn_context_comparison
  authn_context_decl_ref
  security
  soft
)

Instance Method Summary collapse

Instance Method Details

#configuration_options(configuration_options = {}) ⇒ Object



67
68
69
70
71
# File 'lib/rack_entra_id_auth/configuration.rb', line 67

def configuration_options (configuration_options = {})
  configuration_options.slice(:metadata_url, *RUBY_SAML_SETTINGS).each do |key, value|
    self.send("#{key}=", value) unless value.nil?
  end
end

#metadata_urlObject



73
74
75
# File 'lib/rack_entra_id_auth/configuration.rb', line 73

def 
  @metadata_url
end

#metadata_url=(metadata_url) ⇒ Object



77
78
79
80
81
82
83
84
85
86
# File 'lib/rack_entra_id_auth/configuration.rb', line 77

def  ()
  @metadata_url = 

  OneLogin::RubySaml::IdpMetadataParser.new.parse_remote_to_hash()
    .slice(*RUBY_SAML_SETTINGS).each do |key, value|
      self.send("#{key}=", value) unless value.nil?
    end

  @metadata_url
end

#ruby_saml_settingsObject



88
89
90
# File 'lib/rack_entra_id_auth/configuration.rb', line 88

def ruby_saml_settings
  config.to_h.slice(*RUBY_SAML_SETTINGS)
end