Class: Saml::SessionsBaseController

Inherits:
SamlBaseController show all
Defined in:
app/controllers/saml/sessions_base_controller.rb

Direct Known Subclasses

SessionsController

Instance Method Summary collapse

Instance Method Details

#createObject

POST /saml/sign_in



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/saml/sessions_base_controller.rb', line 9

def create
  setting = SpRailsSaml::Settings.instance
  user = setting.user_class.find_by!(setting.user_find_key => params[:email])
   = user.send(setting..to_s.downcase.to_sym)

  raise SpRailsSaml::SamlSettingNotFound if .saml_setting.blank?
  raise SpRailsSaml::SamlLoginForbidden if .saml_setting.password_only?

  if user.blank?
    redirect_to , alert: 'failed to login'
    return
  end

  authnrequest = SpRailsSaml::Authnrequest.new(.saml_setting).to_url
  redirect_to(authnrequest)
end

#newObject

GET /saml/sign_in



6
# File 'app/controllers/saml/sessions_base_controller.rb', line 6

def new; end