简体   繁体   中英

HttpClient fail to login to CAS Service

I'm using Apache Http Components library and I'm trying to login into a CAS System. I found a CAS Client for Android on GitHub, I tried to use it but it doesn't work for me. The problem is that the header of the response doesn't contain the "Location" attribute where I can find the returned ticket.

I tried to use Google chrome to simulate the authentification and I don't know what Google chrome do to get the ticket :3 is it a redirection ? How can I detect it using httpClient ? 在此处输入图片说明

Thank you

You can enable the CAS RESTful API: https://wiki.jasig.org/display/CASUM/RESTful+API Or http://jasig.github.io/cas/4.0.x/protocol/REST-Protocol.html (after 4.0.x)

The REST protocol allows one to model applications as users, programmatically acquiring service tickets to authenticate to other applications. This means that other applications would be able to use a CAS client to accept Service Tickets rather than to rely upon another technology such as client SSL certificates for application-to-application authentication of requests. This is achieved by exposing a way to RESTfully obtain a Ticket Granting Ticket and then use that to obtain a Service Ticket.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM