Fatal error: Uncaught Error: Class 'SimpleSAML\Utils\Random'
tim-breitenstein-it opened this issue · 1 comments
tim-breitenstein-it commented
Follow the README Usage instruction and immediately get this error:
Fatal error: Uncaught Error: Class 'SimpleSAML\Utils\Random' not found in /var/www/dev/vendor/simplesamlphp/saml2/src/SAML2/Compat/Ssp/Container.php:49 Stack trace:
#0 /var/www/dev/vendor/simplesamlphp/saml2/src/SAML2/Message.php(143): SAML2\Compat\Ssp\Container->generateId()
#1 /var/www/dev/vendor/simplesamlphp/saml2/src/SAML2/AuthnRequest.php(144): SAML2\Message->__construct('AuthnRequest', NULL)
#2 /var/www/dev/sso_saml_2.php(52): SAML2\AuthnRequest->__construct()
#3 /var/www/dev/sso_saml_2.php(37): sso_saml_test->login()
#4 /var/www/dev/sso_saml_2.php(105): sso_saml_test->__construct(Array)
#5 {main} thrown in /var/www/dev/vendor/simplesamlphp/saml2/src/SAML2/Compat/Ssp/Container.php on line 49
My code:
// Implement the Container interface (out of scope for example)
//require 'container.php';
$container = ContainerSingleton::initSspContainer();
SAML2\Compat\ContainerSingleton::setContainer($container);
// Set up an AuthnRequest
$request = new SAML2\AuthnRequest();
$request->setId($container->generateId());
$request->setIssuer('https://sp.example.edu');
$request->setDestination('https://idp.example.edu');
// Send it off using the HTTP-Redirect binding
$binding = new SAML2\HTTPRedirect();
$binding->send($request);
Version:
- simplesamlphp/saml2:
4.1.10
- PHP:
7.2.24
jaimeperez commented
As the README says, you need to provide the external dependencies. That means you either install SimpleSAMLphp, or provide your own implementation of the container.