Class: Casablanca::Rails::RenewFilter

Inherits:
Filter
  • Object
show all
Defined in:
lib/casablanca/rails/filter.rb

Overview

Always require new credentials for authentication?

Class Method Summary collapse

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?

Returns:

  • (Boolean)


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"
  (controller)
  return false
end

.redirect_to_cas_login(controller) ⇒ Object



159
160
161
162
163
# File 'lib/casablanca/rails/filter.rb', line 159

def (controller)
  controller.session[:cas_renewed] = true
  logger.debug "Redirecting to #{(controller, :renew => true)}"        
  controller.send(:redirect_to, (controller, :renew => true))
end