simplesamlphp / saml2

SimpleSAMLphp low-level SAML2 PHP library
https://www.simplesamlphp.org
GNU Lesser General Public License v2.1
284 stars 136 forks source link

SAML2\Compat\Ssp\Container::generateId() depends on SimpleSAML_Utilities which is not included as a dependency #125

Closed desjob closed 6 years ago

desjob commented 6 years ago

Consider the following code:

/composer.json

{
    "require": {
        "simplesamlphp/saml2": "~3.1.6"
    }
}

/application.php

<?php
require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';

new \SAML2\Assertion();

After running:

you will get the following error:

PHP Fatal error: Uncaught Error: Class 'SimpleSAML_Utilities' not found in /var/www/farmed-saml-example/vendor/simplesamlphp/saml2/src/SAML2/Compat/Ssp/Container.php:36

It looks like the package simplesamlphp/saml2 has a dependency on simplesamlphp/simplesamlphp, however, this is not provided when requiring simplesamlphp/saml2 through composer.

thijskh commented 6 years ago

I think this is answered by bullet 2 in "Usage": https://github.com/simplesamlphp/saml2#usage

thijskh commented 6 years ago

simplesamlphp/simplesamlphp is not a dependency per se, that's why it's not listed.

desjob commented 6 years ago

Sorry i removed my comment because i should read first :)

So basically simplesamlphp/simplesamlphp is only a dependency if you decide to use the provided SAML2\Compat\Ssp\Container ?

thijskh commented 6 years ago

Yes, you can implement your own container based on the example given.