The instructions for proxying in the rubycas-client README.rdoc have
several errors in them.
Quoting:
service_uri = "
http://some-other-application.example.foo"
proxy_granting_ticket = session[:cas_pgt]
ticket =
CASClient::Frameworks::Rails::Filter.client.request_proxy_ticket
(service_uri, proxy_granting_ticket).ticket
ticket should now contain a valid service ticket. You can use it to
authenticate other services by sending it and the service URI as
parameters to your target application:
http://some-other-application.example.foo?service=#{CGI.encode(ticket.target_service)}&ticket=#{ticket.proxy_ticket}
Comments:
The ticket variable above contains a string, so obviously it doesn't
have target_service or proxy_ticket methods. The object that
request_proxy_ticket returns doesn't have these methods either.
CGI.encode isn't a method -- you're probably looking for CGI::escape.
Here's some code that did work for me:
service_uri = "
http://localhost:3333/some/service"
proxy_granting_ticket = session[:cas_pgt]
ticket =
CASClient::Frameworks::Rails::Filter.client.request_proxy_ticket
(proxy_granting_ticket, service_uri)
response, data = Net::HTTP.new("localhost", 3333).get("/some/
service?ticket=#{ticket.ticket}")
Now I want to do a POST instead of a get. I've tried a bunch of
variants on the above formula, but nothing works -- I always get a
302. Help?
thanks,
Bryan