Class: Osso::SamlHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/osso/lib/saml_handler.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(auth_hash:, provider_id:, session:) ⇒ SamlHandler

Returns a new instance of SamlHandler.



11
12
13
14
15
# File 'lib/osso/lib/saml_handler.rb', line 11

def initialize(auth_hash:, provider_id:, session:)
  find_provider(provider_id)
  @attributes = auth_hash&.extra&.response_object&.attributes
  @session = session
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



5
6
7
# File 'lib/osso/lib/saml_handler.rb', line 5

def attributes
  @attributes
end

#providerObject

Returns the value of attribute provider.



5
6
7
# File 'lib/osso/lib/saml_handler.rb', line 5

def provider
  @provider
end

#sessionObject

Returns the value of attribute session.



5
6
7
# File 'lib/osso/lib/saml_handler.rb', line 5

def session
  @session
end

Class Method Details

.perform(**attrs) ⇒ Object



7
8
9
# File 'lib/osso/lib/saml_handler.rb', line 7

def self.perform(**attrs)
  new(attrs).perform
end

Instance Method Details

#performObject



17
18
19
20
21
# File 'lib/osso/lib/saml_handler.rb', line 17

def perform
  validate_attributes
  provider.active!
  redirect_uri
end