simplesamlphp / simplesamlphp-module-adfs

This module adds support for WS-Federation
GNU Lesser General Public License v2.1
5 stars 5 forks source link

Module Not Functioning in 2.1.0 #15

Closed timconner closed 11 months ago

timconner commented 11 months ago

This instantiation for StreamedResponse is invalid and throws an error: https://github.com/simplesamlphp/simplesamlphp-module-adfs/blob/8b2e3e9df5f7111ab4f6e6482a7e10a5bbe618e5/src/IdP/ADFS.php#L55

Reverting commit https://github.com/simplesamlphp/simplesamlphp-module-adfs/commit/8b2e3e9df5f7111ab4f6e6482a7e10a5bbe618e5 resolves the issue on my 2.1.0 instance.

tvdijen commented 11 months ago

Hi @timconner ! Thanks for reporting this. Could you please confirm that the referenced commit also fixes your issue?

timconner commented 11 months ago

Almost. I needed to replace use SimpleSAML\SAML2\Constants; with use SAML2\Constants; otherwise I get the following error:

Backtrace:
2 src/SimpleSAML/Error/ExceptionHandler.php:35 (SimpleSAML\Error\ExceptionHandler::customExceptionHandler)
1 vendor/symfony/error-handler/ErrorHandler.php:541 (Symfony\Component\ErrorHandler\ErrorHandler::handleException)
0 [builtin] (N/A)
Caused by: Symfony\Component\ErrorHandler\Error\ClassNotFoundError: Attempted to load class "Constants" from namespace "SimpleSAML\SAML2".
Did you forget a "use" statement for e.g. "SimpleSAML\XML\Constants", "SimpleSAML\XMLSecurity\Constants", "SimpleSAML\Module\adfs\SAML2\XML\fed\Constants" or "SAML2\Constants"?
Backtrace:
16 modules/adfs/src/IdP/ADFS.php:90 (SimpleSAML\Module\adfs\IdP\ADFS::generateResponse)
15 modules/adfs/src/IdP/ADFS.php:394 (SimpleSAML\Module\adfs\IdP\ADFS::sendResponse)
14 [builtin] (call_user_func)
13 src/SimpleSAML/IdP.php:282 (SimpleSAML\IdP::postAuthProc)
12 src/SimpleSAML/IdP.php:328 (SimpleSAML\IdP::postAuth)
11 [builtin] (call_user_func)
10 src/SimpleSAML/Auth/Source.php:230 (SimpleSAML\Auth\Source::loginCompleted)
9 [builtin] (call_user_func)
8 src/SimpleSAML/Auth/Source.php:153 (SimpleSAML\Auth\Source::completeAuth)
7 modules/core/src/Auth/UserPassBase.php:317 (SimpleSAML\Module\core\Auth\UserPassBase::handleLogin)
6 modules/core/src/Controller/Login.php:216 (SimpleSAML\Module\core\Controller\Login::handleLogin)
5 modules/core/src/Controller/Login.php:116 (SimpleSAML\Module\core\Controller\Login::loginuserpass)
4 vendor/symfony/http-kernel/HttpKernel.php:163 (Symfony\Component\HttpKernel\HttpKernel::handleRaw)
3 vendor/symfony/http-kernel/HttpKernel.php:75 (Symfony\Component\HttpKernel\HttpKernel::handle)
2 vendor/symfony/http-kernel/Kernel.php:202 (Symfony\Component\HttpKernel\Kernel::handle)
1 src/SimpleSAML/Module.php:234 (SimpleSAML\Module::process)
0 public/module.php:17 (N/A)
timconner commented 11 months ago

Actually that might be just a mistake on my end. If I apply just your fix to the current file in the 2.1.2 tag it works perfectly.

tvdijen commented 11 months ago

Excellent! I'll tag v2.1.3 immediately. Sorry for the inconvenience