Class: Saml::SessionsBaseController
- Inherits:
-
SamlBaseController
- Object
- ApplicationController
- SamlBaseController
- Saml::SessionsBaseController
- Defined in:
- app/controllers/saml/sessions_base_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#create ⇒ Object
POST /saml/sign_in.
-
#new ⇒ Object
GET /saml/sign_in.
Instance Method Details
#create ⇒ Object
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]) account = user.send(setting.account_class.to_s.downcase.to_sym) raise SpRailsSaml::SamlSettingNotFound if account.saml_setting.blank? raise SpRailsSaml::SamlLoginForbidden if account.saml_setting.password_only? if user.blank? redirect_to saml_sign_in_path, alert: 'failed to login' return end authnrequest = SpRailsSaml::Authnrequest.new(account.saml_setting).to_url redirect_to(authnrequest) end |
#new ⇒ Object
GET /saml/sign_in
6 |
# File 'app/controllers/saml/sessions_base_controller.rb', line 6 def new; end |