Resourcs for enabling CAS Rest Access:
- CAS REST API: https://wiki.jasig.org/display/casum/restful+api
- POST to protected resource: https://groups.google.com/forum/#!searchin/jasig-cas-user/post$20to$20rest$20resource/jasig-cas-user/NWmFahj9usk/YBECPJULN3sJ
(make sure redirectAfterValidation = false for the server using CAS to authenticate, but could have unintended consequences for browsers) - More redirectAfterValidation: https://wiki.jasig.org/display/CASC/Configuring+the+Jasig+CAS+Client+for+Java+in+the+web.xml
- CAS on GitHub: https://github.com/Jasig/cas
And here is my simple implementation:
- Main.java contains a runnable main method and makes the calls to our REST service
- CasLogin.java holds our user's credentials and makes the call to get the TicketGrantingTicket and the ServiceGrantingTicket. You might be able to store the TGT in order to avoid passing the credentials over the wire for each request.
- RestClient.java holds some helper methods to make http calls
No comments:
Post a Comment