Class: Devise::Strategies::SamlAuthenticatable

Inherits:
Authenticatable
  • Object
show all
Includes:
DeviseSamlAuthenticatable::SamlConfig
Defined in:
lib/devise_saml_authenticatable/strategy.rb

Instance Method Summary collapse

Methods included from DeviseSamlAuthenticatable::SamlConfig

#saml_config

Instance Method Details

#authenticate!Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/devise_saml_authenticatable/strategy.rb', line 18

def authenticate!
  parse_saml_response
  retrieve_resource unless self.halted?
  unless self.halted?
    if Devise.saml_session_index_key
      request.session[Devise.saml_session_index_key] = @response.sessionindex
    end
    success!(@resource)
  end
end

#store?Boolean

This method should turn off storage whenever CSRF cannot be verified. Any known way on how to let the IdP send the CSRF token along with the SAMLResponse ? Please let me know!

Returns:

  • (Boolean)


32
33
34
# File 'lib/devise_saml_authenticatable/strategy.rb', line 32

def store?
  !mapping.to.skip_session_storage.include?(:saml_auth)
end

#valid?Boolean

Returns:

  • (Boolean)


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

def valid?
  if params[:SAMLResponse]
    OneLogin::RubySaml::Response.new(
      params[:SAMLResponse],
      response_options,
    )
  else
    false
  end
end