[UTF8-Enconding] Issues with mysql backend and saml attributes
Hello,
here is a copy of a bug we reported to lemonldap-ng-users, answered by Clément the 29/03/2017:
We recently installed LemonLdap ::NG in order to : 1st - be our IDProvider SAML 2nd – be our authentication gateway for locale web applications
We are in testing phase with one server, production is scheduled for May with HA (2 loadbalanced servers).
Our version is 1.9.9 over Debian Jessie, with backendconf under MySQL. We are really satisfied of the solution but we got issues with utf8 encoding since we’ve got some accented characters (in saml attributes, in information data (orga name, etc..)..
Here’s a recap of the charset conf : Debian => lang fr_fr.UTF-8 Apache -> defaultCharset utf8 Mysql db and tables charset = utf8 dbiChain also contains : mysql_init_command=set names 'utf8';
Some logs to figure out what’s the cause: When I save a configuration from backoffice, the http request bellow is sent : http/POST (charset=utf8) manager-server.fcgi/confs (update nouvelle conf) -> [Object { new="Métropole Europeenne de Lille", key="samlOrganizationDisplayName", old="Metropole Europeenne de Lille"}] BUT in mysql queries log, I see the update query sent by LLNG : INSERT INTO lmConfig (cfgNum,field,value) VALUES ('179','samlOrganizationDisplayName','Métropole Europeenne de Lille')
It seems LLNG utf8-encoded the character “ é “ while it wasn’t necessary (I guess because wasn’t http request’s content already utf8 encoded?).
We also have issue with SAML tokens, as described here : https://jira.ow2.org/browse/#1081. As C. Oudot suggested us, we upgraded our version from 1.9.7 to 1.9.9 but the problem is still there. The saml attributes with accented characters seem to be double encoded whereas they are properly displayed and stored in LLNG user’ session.
We would be very grateful if you have any ideas or patch corrections we could try.