View Issue Details

IDProjectCategoryView StatusLast Update
0023390mantisbtldappublic2020-11-15 14:16
ReporterMr.Bricodage Assigned Toatrol  
Status resolvedResolutionno change required 
Product Version1.3.12 
Summary0023390: Unable to auth user through SOAP API if special char in LDAP realname

LDAP Realname content (CN) in my company AD sometimes contains special French chars. I haven't access to AD to modify this information. For example, the char é has hexa code \xe9.

This is a "little" problem when displaying data in Mantis GUI ( Gérard is displayed G? ) and a big problem when using SOAP to log in (exception Exception with message "SOAP-ERROR: Encoding: string 'G\xe9...' is not a valid utf-8 string - thrown by method : mc_login"),
==> SOAP cannot be used to authenticate some users.

Additional Information

To partially fix this problem, I modified ldap_api.php, function ldap_realname_from_username on row 186

$t_realname = ldap_get_field_from_username( $p_username, $t_ldap_realname_field );
is now
$t_realname = utf8_decode(ldap_get_field_from_username( $p_username, $t_ldap_realname_field ));

The result is now G?rard in Mantis GUI ( better than G? ) and we can log in through SOAP API.

$t_realname = ldap_escape_string(ldap_get_field_from_username( $p_username, $t_ldap_realname_field )); seems to bypass the problem too but not to display french chars.

TagsNo tags attached.


related to 0027420 closeddregad Cannot login due to UTF8 character using LDAP 
related to 0020809 resolvedatrol Auth with AD KO when UTF-8 chars in password 




2018-03-02 17:35

reporter   ~0059071

based on note 0020809:0059069, I'll try ASAP

$t_realname = use iconv( "UTF-8", "Windows-1252", ldap_get_field_from_username( $p_username, $t_ldap_realname_field ));



2018-06-13 04:04

reporter   ~0060083

Confirmed, by replacing utf-8 decode() by iconv() , special chars are now well displayed



2020-11-01 04:59

developer   ~0064600

There was a similar issue 0027420

The final solution was to set $g_ldap_protocol_version = 3; without any other source tweaks.
See also

Can you confirm that this works for you?



2020-11-15 14:16

developer   ~0064656

Without feedback, assuming the solution to set $g_ldap_protocol_version = 3; addresses the issue.

Issue History

Date Modified Username Field Change
2017-09-22 05:58 Mr.Bricodage New Issue
2018-03-02 17:35 Mr.Bricodage Note Added: 0059071
2018-03-02 21:52 vboctor Relationship added related to 0020809
2018-06-13 04:04 Mr.Bricodage Note Added: 0060083
2020-11-01 04:59 atrol Status new => feedback
2020-11-01 04:59 atrol Note Added: 0064600
2020-11-01 04:59 atrol Relationship added related to 0027420
2020-11-15 14:16 atrol Assigned To => atrol
2020-11-15 14:16 atrol Status feedback => resolved
2020-11-15 14:16 atrol Resolution open => no change required
2020-11-15 14:16 atrol Note Added: 0064656