Class: Casablanca::Rails::RenewFilter
- Defined in:
- lib/casablanca/rails/filter.rb
Overview
Always require new credentials for authentication?
Class Method Summary collapse
-
.authentication_required?(controller) ⇒ Boolean
Has the user already talked to the Cas server?.
- .get_credentials(controller) ⇒ Object
- .redirect_to_cas_login(controller) ⇒ Object
Methods inherited from Filter
authenticate_ticket, filter, logger, login_url, logout, logout_url
Class Method Details
.authentication_required?(controller) ⇒ Boolean
Has the user already talked to the Cas server?
149 150 151 |
# File 'lib/casablanca/rails/filter.rb', line 149 def authentication_required?(controller) (controller.session[:cas_user].nil? || controller.session[:cas_renewed].nil?) && controller.params[:ticket].nil? end |
.get_credentials(controller) ⇒ Object
153 154 155 156 157 |
# File 'lib/casablanca/rails/filter.rb', line 153 def get_credentials(controller) logger.debug "Always require credentials for authentication" redirect_to_cas_login(controller) return false end |
.redirect_to_cas_login(controller) ⇒ Object
159 160 161 162 163 |
# File 'lib/casablanca/rails/filter.rb', line 159 def redirect_to_cas_login(controller) controller.session[:cas_renewed] = true logger.debug "Redirecting to #{login_url(controller, :renew => true)}" controller.send(:redirect_to, login_url(controller, :renew => true)) end |