derricksmith / phpsaml

GLPI Plugin - SAML integration using the Onelogin SAML Library
MIT License
32 stars 24 forks source link

SAML issue GLPI 10.0.9 #148

Closed Juliiiien closed 1 year ago

Juliiiien commented 1 year ago

Hello, I updated my GLPI (for dev) from 9.5.11 to 10.0.9

I tried to update my plugin from 1.2.0 to 1.2.1 (I did any modification on parameters between these 2 versions) This plugin worked well before all my updates (GLPI 9 + phpsaml 1.2.0)

I get this error : image

In my server log I get this :

2023-07-27 16:26:10 [@myservername]
Invalid SAML Response
[2023-07-27 14:26:10] glpiphplog.WARNING:   *** PHP Warning (2): Undefined global variable $_POST in /path/to/glpi/src/Application/View/TemplateRenderer.php at line 120
  Backtrace :
  src/Application/View/TemplateRenderer.php:135      Glpi\Application\View\TemplateRenderer->__construct()
  src/Html.php:1296                                  Glpi\Application\View\TemplateRenderer::getInstance()
  src/Html.php:2026                                  Html::includeHeader()
  plugins/phpsaml/front/acs.php:62                   Html::nullHeader()
  public/index.php:82                                require()

Is it working with GLPI 10.0.9 ?

Thks

DonutsNL commented 1 year ago

Hi @Juliiiien,

You might want to use this updated version: https://github.com/DonutsNL/phpsaml/tree/master that contains various fixes and changes. It is also compatible with your version. @derricksmith has been away for some time now and he is the only one that can merge pull requests (changes and corrections made by others).

In regards to the POST error. You can ignore that error. This is caused by phpsaml that 'captures' the POST before GLPI is able to proces it and then unsets $_POST variable. In the latest version i changed this behaviour, now phpsaml will only nullify the variable.

https://github.com/DonutsNL/phpsaml/blob/8f129bb28ebeda9552728dfeeaa35a9f17dbe64b/front/acs.php#L4

Looking at you specific error phpsaml states that the found signature isnt correct and the library is therefor refusing the samlresponse it received. Using the newer version might give you more insight into the issue. It also allows you to dump and review the serverside received samlresponse. For this you need to enable debug in the phpsaml config and manually create a dump folder in the phpsaml pluginfolder.

Juliiiien commented 1 year ago

It was a miss config from me ... ty