CAS in SugarCRM

It’s possible to use Jasig CAS for SugarCRM Authentication.

First install CAS PHP then in your sugar install go to modules/Users/authentication and place CASAuthenticate. I hard coded my server settings in so make sure to edit the files for your purposes. Edit – you can get a nicer version here on github.

Then edit config.php add

'authenticationClass' => 'CASAuthenticate',

to $sugar_config = array

SugarCRM is supposed to support SAML but I haven’t been able to make it work.

By David

I am a supporter of free software and run Burke Software and Consulting LLC. I am always looking for contract work especially for non-profits and open source projects. Open Source Contributions I maintain a number of Django related projects including GlitchTip, Passit, and django-report-builder. You can view my work on gitlab. Academic papers Incorporating Gaming in Software Engineering Projects: Case of RMU Monopoly in the Journal of Systemics, Cybernetics and Informatics (2008)


  1. Hello David, Thanks for your work.
    But I have an issue during the integration of your files

    Firstly: UserAuthenticateClass.php in not used, why is it on the folder ?

    Secondly : i have that error :

    phpCAS error: phpCAS::client(): Another session was started before phpcas. Either disable the session handling for phpcas in the client() call or modify your application to leave session handling to phpcas in /var/www/SugarCE-Full-6.2.0beta3/modules/Users/authentication/CASAuthenticate/CASAuthenticateUser.php on line 31

    And I don’t know how to fix it yet,
    please help me


    1. Glad you figured it out. I’d love make a real sugar plugin I just need the time. Those files are a huge hack, there’s probably a lot of unnecessary code.


  2. Hello David,
    Thanks for the info. We are looking to integrate CAS with our SugarCRM 6.5 installation but noticed the CASAuthenticate file you reference above is missing. Was wondering if maybe you had it somewhere else on the interwebs.

    Thanks for any help.


  3. I’ve fixed the link. I still works for me in 6.4 and presumably 6.5. Never had an issue with updates.

    Still a hard coded hack.


  4. Thanks a lot for the code David. I was able to get everything working with help from Maximilien’s second comment above.

    I took the liberty to place the files on Github so maybe more people can have access to it, and help to improve it. I took out the hardcoding so people can just edit the config.php file.

    I tried to give you credit. Check out the repo at


  5. Parse error: syntax error, unexpected $end, expecting T_FUNCTION in /opt/installs/test/CAS-1.3.1/CAS/Client.php on line 603

    I am struck with this error…could anyone please help me???


Leave a comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: