We Provide Top Notch Drupal Support & Enterprise Solutions

Symfony 2 CAS Rest Bundle: Authenticate Against CAS gracefully

Cas Rest Bundle allows you to authenticate against a CAS server via RESTFUL services. This bundle works with the awesome FosUserBundle. The beauty of this bundle is that you do not have to see the nasty CAS login screen as everything you do is over web services thus resulting in a fully customizable experience.

Authored by Saud Faisal

Now go into your app/config.yml and do something as follows:


main_cas_rest:
 cas_rest_url: https://sso.myserver.com/cas/restapi/tickets
 cas_service_url: https://sso.myserver.com/cas/serviceValidate
 cas_cert: /usr/share/ca-certificates/extra/ca.crt
 cas_local:
 source_dn:
 base_dn:
 service_url:

Please note that you will have to adjust the path for cas_cert as it is located on your machine.

Also note that as the bundle stands for now, it will first authenticate locally. In the event you are able to log on, everything is fine. In the event that the authentication fails, it will then go to the CAS server, and create a local DB user on successful authentication and then log you in.

Future versions will allow you to customize this experience fully.

This bundle is in middle of some cleanup and we will do our best to refactor it further. Also we will be adding tests in future.

https://github.com/2levelsabove/CasRestBundle

This Symfony bundle was written by us as we were trying to solve a complex login integration. Written by our very own Saud Faisal

Author: Tony

Share This Post On

Submit a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>