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

#get_saml_config

Instance Method Details

#authenticate! ⇒ Object



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

def authenticate!
  @response = OneLogin::RubySaml::Response.new(params[:SAMLResponse])
 @response.settings = get_saml_config
 resource = mapping.to.authenticate_with_saml(@response.attributes)
  if @response.is_valid?
    success!(resource)
  else
    fail!(:invalid)
  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)


23
24
25
# File 'lib/devise_saml_authenticatable/strategy.rb', line 23

def store?
  true
end

#valid? ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/devise_saml_authenticatable/strategy.rb', line 6

def valid?
  params[:SAMLResponse]
end