Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProxyTicket not validated #221

Open
showy opened this issue Aug 15, 2014 · 0 comments
Open

ProxyTicket not validated #221

showy opened this issue Aug 15, 2014 · 0 comments

Comments

@showy
Copy link

showy commented Aug 15, 2014

Hi,

The CAS server wasn't validating proxy tickets using the validate_service_ticket method.

--- a/lib/casserver/cas.rb
+++ b/lib/casserver/cas.rb
     if service.nil? or ticket.nil?
       error = Error.new(:INVALID_REQUEST, "Ticket or service parameter was missing in the request.")
       $LOG.warn "#{error.code} - #{error.message}"
-    elsif st = ServiceTicket.find_by_ticket(ticket)
+    elsif st = ( ServiceTicket.find_by_ticket(ticket) || ProxyTicket.find_by_ticket(ticket) )
       if st.consumed?
         error = Error.new(:INVALID_TICKET, "Ticket '#{ticket}' has already been used up.")
         $LOG.warn "#{error.code} - #{error.message}"

Addtionally the CAS server was throwing an undefined method (granted_by_tgt) for ProxyTicket objects while trying to get the user attributes associated for a ticket.

--- a/lib/casserver/server.rb
+++ b/lib/casserver/server.rb
@@ -700,7 +700,7 @@ module CASServer
             @pgtiou = pgt.iou if pgt
           end

-          @extra_attributes = t.granted_by_tgt.extra_attributes || {}
+          @extra_attributes = t.granted_by_pgt.service_ticket.granted_by_tgt.extra_attributes || {}
         end
       else
         @success = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant