Class: DeviseSamlAuthenticatable::DefaultIdpEntityIdReader

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

Class Method Summary collapse

Class Method Details

.entity_id(params) ⇒ Object


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/devise_saml_authenticatable/default_idp_entity_id_reader.rb', line 3

def self.entity_id(params)
  if params[:SAMLRequest]
    OneLogin::RubySaml::SloLogoutrequest.new(
      params[:SAMLRequest],
      settings: Devise.saml_config,
      allowed_clock_drift: Devise.allowed_clock_drift_in_seconds,
    ).issuer
  elsif params[:SAMLResponse]
    OneLogin::RubySaml::Response.new(
      params[:SAMLResponse],
      settings: Devise.saml_config,
      allowed_clock_drift: Devise.allowed_clock_drift_in_seconds,
    ).issuers.first
  end
end