CAS Implementation in SuiteCRM 7.10.27

Hi any one have help me out to implementation in CAS authentication in SUITECRM 7.10.27.

Thanks

@kumaran3657
Welcome to community!
Look at teh post. May be it help you.

It’s not working.

I am implemented the CAS but after CAS login home page, index.php, Repair and rebuild most of the pages is not working.

Any one kindly help me.

Thanks

@kumaran3657

Sorry, I don’t use CAS and you don’t give details.
Do you saw as working LDAP Authentication (modules/Users/authentication/LDAPAuthenticate)?

Hi @kumaran3657,

We implemented phpCAS inside our suitecrm 7.10.x version. You need to download phpcas. You can achieve that adding it to the composer.ext.json file.

  1. Add “apereo/phpcas”: "1.3.* to the composer.ext.json file.
  2. Take a look at out repository https://github.com/gcoop-libre/SuiteCRM-CAS. There is a readme at that repository to help you. That repository containts two files that you need to add to your suitecrm implementation and the set some config at you config_override.php file.

Cheers!
Luciano Rossi

1 Like

Hi Thanks for Supporting me… I integrated yesterday. Now it’s working for me.

2 Likes

Get the CAS Package from here https://apereo.atlassian.net/wiki/spaces/CASC/pages/103252517/phpCAS

Add the code into your config.php file.

'authenticationClass' => 'CASAuthenticate',
  'cas' => array(
    'library' => ' Path to  the phpCAS/CAS.php',
    'hostname' => 'URL of the host',
    'port' => PORT of the host,
    'uri' => '',
    'changeSessionID' => FALSE,
    'proxies' => array(
      'HOST URL',
    ),
    'logout_return_url' => 'YOUR Local index page url',
  ),

If you want CAS login users to store your DB To Customise the modules/Users/authentication/CASAuthenticate/CASAuthenticateUser.php page.

Function Name : authUser()

if(phpCAS::isAuthenticated() == 1 && phpCAS::isSessionAuthenticated() ==1) {
               
                if(!empty($_SESSION['authenticated_user_id']) || !empty($user_name)){
        
                    **$GLOBALS['current_user'] = $this->createOrUpdateuser();**

                    $dbresult = DBManagerFactory::getInstance()->query(
                        "SELECT id, status FROM users WHERE user_name='"
                        .$user_name . "' AND deleted = 0"
                    );
                    
                    if ($row = DBManagerFactory::getInstance()->fetchByAssoc($dbresult)) {
                        if ($row['status'] != 'Inactive') {

                            return $this->loadUserOnSession($row['id']);
                        } else {
                            return '';
                        }
                    }
                }
            }

Like you can $this->createOrUpdateuser(); this kind of function inside the page and add it your’s needed data into your Table.

1 Like