SAML Authentication Issue

Hello,

I have installed a clean version of SuiteCRM 7.10.7 and everything is working apart from enabling SAML Authentication. When I enable it and go to the login page it gives me the following error:

Fatal error: Uncaught Error: Class ‘OneLogin_Saml2_Auth’ not found in /home/…/public_html/modules/Users/authentication/SAML2Authenticate/SAML2Authenticate.php:74 Stack trace: #0
/home/…/public_html/modules/Users/Login.php(46): SAML2Authenticate->pre_login() #1 /home/…/public_html/include/MVC/View/SugarView.php(840): include_once(’/home/thecrmela…’) #2
/home/…/public_html/include/MVC/View/views/view.classic.php(74): SugarView->includeClassicFile(‘modules/Users/L…’) #3 /home/…/public_html/include/MVC/View/SugarView.php(207): ViewClassic->display() #4 /home/…/public_html/include/MVC/Controller/SugarController.php(432): SugarView->process() #5 /home/…/public_html/include/MVC/Controller/SugarController.php(375): SugarController->processView() #6
/home/…/public_html/include/MVC/SugarApplication.php(109): SugarController->execute() #7 /home/…/public_html/index.php(52): SugarApplication->execute() #8 { in
/home/…/public_html/modules/Users/authentication/SAML2Authenticate/SAML2Authenticate.php on line 74

I’ve reinstalled SuiteCRM from scratch and it gave me the same error again. I am not sure what is causing this issue can someone help?

PHP 7.1
Centos 7.5

Have a look at these issues and see if any one of them looks similar:

https://github.com/salesagility/SuiteCRM/issues?utf8=✓&q=is%3Aissue+sort%3Aupdated-desc+saml

Tell me your findings and I’ll try to help from there.

I had a look at the list and the last thread and this specific comment https://github.com/salesagility/SuiteCRM/issues/2819#issuecomment-269552522 talks about how the method names have changed in the newer versions of the library.

So I looked at the changes to SAML2Authenticate.php on github and this commit https://github.com/salesagility/SuiteCRM/commit/abb424a6a426428dd75ff0212719c1804ef2cb97#diff-d76748b54ac6b5886a2ec239580c55d5 moved the loading of the php-saml lib to composer.

Looked at the composer.json in the latest version the required version is not the same in the commit.


  "require": {
...
    "psr/log": "^1.0",
    "league/oauth2-server": "^5.1",
    "justinrainbow/json-schema": "^5.2",
    "onelogin/php-saml": "3.0.0.x-dev as 3.0.0",
    "google/recaptcha": "^1.1",
    "ezyang/htmlpurifier": "^4.10"
  },

When I put back in the following line back in SAML2Authenticate.php the error has disappeared so I can only assume that the wrong version is being used in composer.

require_once dirname(dirname(__FILE__)).'/SAML2Authenticate/lib/onelogin/php-saml/_toolkit_loader.php';

I’ve not had a chance to see if this change will resolve my issue completely but the referenced library in composer will need to be fixed.

Ok. If you find something that should be changed in the core code, please open an issue for it on GitHub and explain.

Thanks!