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

toString() method in RDN class escapes special characters and Umlauts #3

Closed
anessi opened this issue Mar 11, 2024 · 1 comment
Closed

Comments

@anessi
Copy link

anessi commented Mar 11, 2024

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 😃

@jsumners
Copy link
Member

This is a duplicate of ldapjs/filter#9 (comment)

@jsumners jsumners closed this as not planned Won't fix, can't repro, duplicate, stale Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants