Class: Casablanca::CommandLineClient
- Defined in:
- lib/casablanca/client.rb
Instance Attribute Summary collapse
-
#ticket_granting_ticket ⇒ Object
readonly
Returns the value of attribute ticket_granting_ticket.
Attributes inherited from Client
Instance Method Summary collapse
-
#login(username, password) ⇒ Object
Logs in to the CAS server and returns the response.
- #logout(follow_url = nil) ⇒ Object
Methods inherited from Client
#authenticate_ticket, #initialize, #logger, logger, logger=, #logger=, #login_url, #logout_url, #validate_url
Constructor Details
This class inherits a constructor from Casablanca::Client
Instance Attribute Details
#ticket_granting_ticket ⇒ Object (readonly)
Returns the value of attribute ticket_granting_ticket.
125 126 127 |
# File 'lib/casablanca/client.rb', line 125 def ticket_granting_ticket @ticket_granting_ticket end |
Instance Method Details
#login(username, password) ⇒ Object
Logs in to the CAS server and returns the response
128 129 130 131 132 133 |
# File 'lib/casablanca/client.rb', line 128 def login(username, password) @ticket_granting_ticket = nil response = post(URI.parse(login_url), {:username => username, :password => password, :service => service_url}) set_ticket_granting_ticket(response) get_service_ticket(response) end |
#logout(follow_url = nil) ⇒ Object
135 136 137 138 139 140 |
# File 'lib/casablanca/client.rb', line 135 def logout(follow_url=nil) @ticket_granting_ticket = nil uri = URI.parse(logout_url) uri.merge_query(:url => follow_url) if follow_url get(uri) end |