Class: CASinoCore::Processor::Logout

Inherits:
CASinoCore::Processor show all
Includes:
Helper::TicketGrantingTickets
Defined in:
lib/casino_core/processor/logout.rb

Overview

The Logout processor should be used to process GET requests to /logout.

Instance Method Summary collapse

Methods included from Helper::TicketGrantingTickets

#acquire_ticket_granting_ticket, #cleanup_expired_ticket_granting_tickets, #find_valid_ticket_granting_ticket, #load_or_initialize_user, #remove_ticket_granting_ticket

Methods included from Helper::Logger

#logger

Methods included from Helper::Browser

#browser_info, #same_browser?

Methods inherited from CASinoCore::Processor

#initialize

Constructor Details

This class inherits a constructor from CASinoCore::Processor

Instance Method Details

#process(params = nil, cookies = nil, user_agent = nil) ⇒ Object

This method will call #user_logged_out and may supply an URL that should be presented to the user. As per specification, the URL specified by “url” SHOULD be on the logout page with descriptive text. For example, “The application you just logged out of has provided a link it would like you to follow. Please click here to access www.go-back.edu/.”

Parameters:

  • params (Hash) (defaults to: nil)

    parameters supplied by user

  • cookies (Hash) (defaults to: nil)

    cookies supplied by user

  • user_agent (String) (defaults to: nil)

    user-agent delivered by the client



17
18
19
20
21
22
23
24
25
26
# File 'lib/casino_core/processor/logout.rb', line 17

def process(params = nil, cookies = nil, user_agent = nil)
  params ||= {}
  cookies ||= {}
  remove_ticket_granting_ticket(cookies[:tgt], user_agent)
  if params[:service] && CASinoCore::Model::ServiceRule.allowed?(params[:service])
    @listener.user_logged_out(params[:service], true)
  else
    @listener.user_logged_out(params[:url])
  end
end