Class: DeviseSamlAuthenticatable::DefaultAttributeMapResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/devise_saml_authenticatable/default_attribute_map_resolver.rb

Instance Method Summary collapse

Constructor Details

#initialize(saml_response) ⇒ DefaultAttributeMapResolver

Returns a new instance of DefaultAttributeMapResolver.



3
4
5
# File 'lib/devise_saml_authenticatable/default_attribute_map_resolver.rb', line 3

def initialize(saml_response)
  @saml_response = saml_response
end

Instance Method Details

#attribute_mapObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/devise_saml_authenticatable/default_attribute_map_resolver.rb', line 7

def attribute_map
  return {} unless File.exist?(attribute_map_path)

  attribute_map = YAML.load(File.read(attribute_map_path))
  if attribute_map.key?(Rails.env)
    attribute_map[Rails.env]
  else
    attribute_map
  end
end