I’m trying to implement SimpleSAMLphp authentication to my Yii framework based site. Since SimpleSAMLphp is located out of web server’s DocumentRoot, it can’t be put anywhere under “protected” directory. So my question is how to register and use 3rd-party classes which are located out of Yii document root.
Here are the steps I made:
Create new module. Location - /var/yii-site/protected/module/simplesamlphp
Thanks for the help. Unfortunately, I fall into another problem - SimpleSAMLphp has its own autoloader, so it throws error when trying to create 3rd-party object:
Yii::setPathOfAlias('ssaml', $this->simplesamlphpPath . '/lib/_autoload.php');
Yii::import('ssaml');
$this->as = new SimpleSAML_Auth_Simple($this->authenticationSource); // <-- here comes error:
include(SimpleSAML_Auth_Simple.php): failed to open stream: No such file or directory
There is no such file, so it won’t be able to find it anywhere…
It doesn’t look so “clean”, but at least it works. It would be great to use Yii methods to import classes, create objects, but I can’t find the way how to do that.