This repository was archived by the owner on May 14, 2024. It is now read-only.

Description
During LDAP integration of our backstage.io project I noticed that authentication of users which have Umlaut (e.g. äöü) in their DN fails. This is due to the fact that any Umlaut in the RDN gets escaped.
The toString() function is called in https://github.com/ldapjs/dn/blob/master/lib/dn.js#L253.
In 57f54c7 I noticed that a feature has been implemented to suppress encoding the values, but there's not way to configure this.
Setting options globally seems to be deprecated and no longer supported
The only workaround I have found is to monkey patch the toString() function like this:
import { RDN } from 'ldapjs'
let originalToString = RDN.prototype.toString;
RDN.prototype.toString = function() {
// @ts-ignore
return originalToString.apply(this, [{ unescaped: true }])
};
Is there a better way to configure this or are there any plans to make it configurable?
Disclaimer: I'm a not a JS dev 😃