Hi
A workaround from the devs was to change this line of code (in seahub/thirdpart/shibboleth/middleware.py) from
158 if nickname.strip(): # set nickname when it's not empty
159 p.nickname = nickname
to
158 if nickname.strip(): # set nickname when it's not empty
159 p.nickname = nickname.encode("iso-8859-1”).decode('utf8')
This patch worked well
Users are now filled with
Prénom Nom
François Dupond
But seahub.log still logs bad encoding
[ERROR] shibboleth.middleware:144 make_profile {'contact_email': 'prenom.nom@domaine.fr', 'givenname': 'Prénom', 'surname': 'Nom'}
[ERROR] shibboleth.middleware:144 make_profile {'contact_email': 'francois.dupond@exemple.org', 'givenname': 'françois', 'surname': 'Dupond’}
The patch looks like a a workaround : it will not be included a future release, as is it language-dependent.
I wonder if the issue should not been solved earlier in the transaction, at the SP or Apache level, to encode HTTP Headers into UTF-8.
I tried many options on apache vhost config, such as
#encoding
AddDefaultCharset utf-8
xml2EncDefault utf-8
With no success
I think i found an issue on Shibboleth project (13 years before, never solved…)
https://issues.shibboleth.net/jira/browse/SSPCPP-2
The solution is to re-encode attributes, e.g. with:
String value= request.getHeader("givenName");
value= new String( value.getBytes("ISO-8859-1"), "UTF-8");
This is what the patch does, so it’s good.
Well, if there is no generic solution to catch French accentuated attributes, i can do one of the following
- add a macro in our LLNG IDP to convert accentuated to non accentuated characters (only for this SP)
- replace thesee characters in the LDAP (givenname and sn may not contains some, only displayname should [but it’s not mandatory])