Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.
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

Description

@anessi

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 😃

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions