derricksmith / phpsaml

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

update configuration failed GLPI 10.0.1 Plugin 1.2.1 #101

Open b0n0is opened 2 years ago

b0n0is commented 2 years ago

Hello, I succeed to install the plugin 1.2.1 in my preproduction glpi server (the preproduction servers (GLPI 10.0.1 + PHP 8.1) is an update from my the GLPI production server (GLPI 9.5.7, PHP 7.2 and plugin 1.1.1)) my problem actually, when I update the configuration on PHP SAML Configuration I have an error image I filled all cases, when I click on update, it seems saving the update, but after the cases are empty

Someone have the same problem and solved it ? Thank you in advance

derricksmith commented 2 years ago

Error indicates a required field is missing.

if (empty($post["saml_idp_entity_id"])){ $messages["errors"]["saml_idp_entity_id"] = "Field cannot be empty"; }

    if (empty($post["saml_idp_single_sign_on_service"])){
        $messages["errors"]["saml_idp_single_sign_on_service"] = "Field cannot be empty";
    }

    if (empty($post["saml_idp_single_logout_service"])){

    }

    if (empty($post["saml_idp_certificate"])){
        $messages["errors"]["saml_idp_certificate"] = "Field cannot be empty";
    }

    if ($post["saml_security_nameidencrypted"] == 1){
        if (empty($post["saml_sp_certificate"]) || empty($post["saml_sp_certificate_key"])){
            $messages["errors"]["saml_security_nameidencrypted"] = "SP Certificate and Key required";
        }
    }

    if ($post["saml_security_authnrequestssigned"] == 1){
        if (empty($post["saml_sp_certificate"]) || empty($post["saml_sp_certificate_key"])){
            $messages["errors"]["saml_security_authnrequestssigned"] = "SP Certificate and Key required";
        }
    }

    if ($post["saml_security_logoutrequestsigned"] == 1){
        if (empty($post["saml_sp_certificate"]) || empty($post["saml_sp_certificate_key"])){
            $messages["errors"]["saml_security_logoutrequestsigned"] = "SP Certificate and Key required";
        }
    }

    if ($post["saml_security_logoutresponsesigned"] == 1){
        if (empty($post["saml_sp_certificate"]) || empty($post["saml_sp_certificate_key"])){
            $messages["errors"]["saml_security_logoutresponsesigned"] = "SP Certificate and Key required";
        }
    }
b0n0is commented 2 years ago

Hi Derrick, thank you for your answer i filled all cases here are the screenshots of the configuration image image image image after I click on update, it loads then I have the PHP SAML Configuration page empty image

it's like it doesn't save the configuration

Ketchup31 commented 2 years ago

Hi,

I have the same problem and as workaround I insert a row in the database directly ith the following SQL statements (before you need to be connected to your mySQL). The values hereunder are not the same than you but you can retrieve them easily by testing them in the statement.

The table structure is the following: id,version, enforced, strict, debug, jit, saml_sp_certificate, saml_sp_certificate_key, saml_sp_nameid_format, saml_idp_entity_id, saml_idp_single_sign_on_service, saml_idp_single_logout_service, saml_idp_certificate, requested_authn_context, requested_authn_context_comparison,saml_security_nameidencrypted,saml_security_authnrequestssigned,saml_security_logoutrequestsigned,saml_security_logoutresponsesigned

The SQL statement that I use is:

describe glpi_plugin_phpsaml_configs;
DELETE FROM glpi_plugin_phpsaml_configs;
INSERT INTO glpi_plugin_phpsaml_configs 
VALUES (
'1',
'1',
'0',
'0',
'1',
'0',
'',
'',
'username',
'<IDP ID>',
'<SSO Sing-in URL>',
'<SSO Logout URL>',
'<IDP X509 CERTIFICATE>',
'',
'minimum',
'0',
'0',
'0',
'0'
);

After that you should be able to use the GUI to update your phpSAML settings. Maybe the best would be to do it as soon as you have performed your SQL insert.

b0n0is commented 2 years ago

Hi @Ketchup31 worked by adding information directly to the database, and can change the data directly from the web page strange as issue

DonutsNL commented 1 year ago

Should be (at least validated) and fixed in latest version performing an uninstall and reinstall of the plugin.