Skip to content

Commit

Permalink
Cleaning up refactoring of single sign out
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffroh committed Mar 15, 2013
1 parent ba080e6 commit cb23f00
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ These configuration options are detailed here for your convenience. For specific
* `service_list`: List of services that use this server to authenticate, separated by environment.
* `default_redirect_url`: If the requested service isn't in the service_list (or is blank) then tickets will be generated for the valid services then the user will be redirected to here. Needs to be specified per environment as per the sample below. The default_redirect_url needs to be on the same domain as (at least) one of the urls on the service_list.
* `loosely_match_services`: If this is set to true, a request for the service http://www.something.com/something_else can be matched to the ticket for http://www.something.com.
* `enable_single_sign_out`: If this is set to true, calling Cassy::ServiceTicket#send_logout_notification(service_ticket_hash) will send a request to the service telling it to clear the associated users session. Calling Cassy::TicketGrantingTicket.destroy_and_logout_all_service_tickets will send a session-terminating request to each service before destroying itself.
* `enable_single_sign_out`: If this is set to true, calling send_logout_notification on a service ticket will send a request to the service telling it to clear the associated users session. Calling destroy_and_logout_all_service_tickets on a ticket granting ticket will send a session-terminating request to each service before destroying itself.
* `no_concurrent_sessions`: (requires enable_single_sign_out to be true) If this is true, when someone logs in, a session-terminating request is sent to each service for any old service tickets related to the current user.


For your viewing pleasure, here is a sample `cassy.yml` file:
A sample `cassy.yml` file:

maximum_unused_login_ticket_lifetime: 7200
maximum_unused_service_ticket_lifetime: 7200
Expand Down
2 changes: 1 addition & 1 deletion app/models/cassy/ticket_granting_ticket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def previous_ticket
def destroy_and_logout_all_service_tickets
if Cassy.config[:enable_single_sign_out]
granted_service_tickets.each do |st|
Cassy::ServiceTicket.send_logout_notification(st)
st.send_logout_notification
end
destroy
else
Expand Down
2 changes: 1 addition & 1 deletion spec/models/ticket_granting_ticket_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
end

it "sends a logout notification for all granted service tickets before being destroyed" do
Cassy::ServiceTicket.should_receive(:send_logout_notification).with(@service_ticket)
Cassy::ServiceTicket.any_instance.should_receive(:send_logout_notification)
@ticket_granting_ticket.destroy_and_logout_all_service_tickets
expect {
Cassy::TicketGrantingTicket.find(@ticket_granting_ticket.id)
Expand Down

0 comments on commit cb23f00

Please sign in to comment.