catalyst / moodle-auth_saml2

SAML done 100% in Moodle, fast, simple, secure
https://moodle.org/plugins/auth_saml2
70 stars 132 forks source link

Issue with PHP8.3 and Moodle 4.4 #813

Closed SiwatS closed 2 months ago

SiwatS commented 2 months ago

What happened? The server returns 500 when logging in to moodle with SAML2

Please provide as many of the following as applies:

image

With debugging enable, this is shown in apache2's error.log

I tried https://example.com/auth/saml2/test.php and it works fine

image

PS: I replace the actual domain with example.com What you expected: Could this be an issue with version mismatch?

kabalin commented 2 months ago

Hello, the fatal error suggest the issue is in Moodle:

PHP Fatal error:  Declaration of DI\\Container::get(string $id): mixed must be compatible with Psr\\Container\\ContainerInterface::get($id) in /var/www/moodle/lib/php-di/php-di/src/Container.php on line 124, referer: https://example.com/login/index.php

But it would probably be noticed already many times. Do you have something unique at your setup apart of Moodle and SAML2? I have a feeling that somehow Psr\\Container\\ContainerInterface namespace points to a different copy of Container at your case (not at lib/psr/container/src/ContainerInterface.php which declaration matches implemetation).

SiwatS commented 2 months ago

Hi, thanks for reading. This is a fresh installation of moodle 4.4, the only plugin it have is SAML2 image It is installed on Ubuntu 22.04 with PHP8.3 and apache2.

IrArevalo00 commented 2 months ago

Hello, suffering the same problem here and test.php works as well. Interestingly, if dual authentication methods are enabled (such as saml2 and manual accounts) not even the manual accounts login prompt appears, I receive a 500 error instead

mkpelletier commented 2 months ago

I am also using this version with Moodle 4.4, but with PHP 8.2.18. The plugin works for the most part, but it does not redirect properly. I can't say for sure, but it may be in classes/auth.php line 814 that does not complete as expected. I just get a white page, but if I put in my desired url after authentication, I am logged in. This plugin worked flawlessly on 4.3, but the php version was 7.4.

mkpelletier commented 2 months ago

I can confirm that PR #812 appears to fix the problems seen in 4.4.

SiwatS commented 2 months ago

I can confirm that PR #812 appears to fix the problems seen in 4.4.

Upgrading to PR #812 does indeed works.