Class: CASServer::Controllers::LoginTicketDispenser

Inherits:
R
  • Object
show all
Includes:
CASServer::CAS
Defined in:
lib/casserver/controllers.rb

Overview

Controller for obtaining login tickets. This is useful when you want to build a custom login form located on a remote server. Your form will have to include a valid login ticket value, and this can be fetched from the CAS server using this controller’ POST method.

Instance Method Summary collapse

Methods included from CASServer::CAS

clean_service_url, #generate_login_ticket, #generate_proxy_granting_ticket, #generate_proxy_ticket, #generate_service_ticket, #generate_ticket_granting_ticket, #send_logout_notification_for_service_ticket, #service_uri_with_ticket, #validate_login_ticket, #validate_proxy_granting_ticket, #validate_proxy_ticket, #validate_service_ticket, #validate_ticket_granting_ticket

Instance Method Details

#getObject



412
413
414
415
416
417
# File 'lib/casserver/controllers.rb', line 412

def get
  CASServer::Utils::log_controller_action(self.class, input)
  $LOG.error("Tried to use login ticket dispenser with get method!")
  @status = 422
  _("To generate a login ticket, you must make a POST request.")
end

#postObject

Renders a page with a login ticket (and only the login ticket) in the response body.



421
422
423
424
425
426
427
428
429
430
# File 'lib/casserver/controllers.rb', line 421

def post
  CASServer::Utils::log_controller_action(self.class, input)
  lt = 

  $LOG.debug("Dispensing login ticket #{lt} to host #{(@env['HTTP_X_FORWARDED_FOR'] || @env['REMOTE_HOST'] || @env['REMOTE_ADDR']).inspect}")

  @lt = lt.ticket

  @lt
end