You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 14, 2024. It is now read-only.
I want to match subject and get output "true" but getting "false" in ldapjs version 3.0.0, it was "true" in ldapjs version 2.3.3.
import ldapjs from 'ldapjs';
Please provide a minimal reproducible example (MRE). Doing so will help us diagnose your issue. It should be the bare minimum code needed to trigger the issue, and easily runnable without any changes or extra code. Please review the integration tests, e.g. issue-940.test.js, for examples of good MREs.
You may use a GitHub repository to host the code if it is too much to fit in a code block (or two).
if rdns is an array of rdn objects, why make rdns private? There are useful functions in the rdn object to use, but you can't get at them...
I'm not following now to use a dn object, similar to this guy's question. And, the docs say to reference the rdns object in dn.rdns, so.....I'm guessing it's just outdated docs.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I want to match subject and get output "true" but getting "false" in ldapjs version 3.0.0, it was "true" in ldapjs version 2.3.3.
import ldapjs from 'ldapjs';
function subjectMatches(actual, expected) {
try {
const actualDN = ldapjs.parseDN(actual);
const expectedDN = ldapjs.parseDN(expected);
const actualRDNs = actualDN.rdns.map(rdn => rdn.toString());
const expectedRDNs = expectedDN.rdns.map(rdn => rdn.toString());
const checker = (arr, target) => target.every(v => arr.includes(v));
if (actualRDNs.length != expectedRDNs.length || !checker(expectedRDNs, actualRDNs)) {
throw new Error('invalid tls_client_auth_subject_dn claim');
}
} catch (err) {
return false;
}
return true;
}
// Certificate, eidas, subject DN, RDNs
console.log(
subjectMatches(
'CN=875HGJHJHJ,organizationIdentifier=xyz-abc-123,O=ABC,C=GB',
'CN=875HGJHJHJ,organizationIdentifier=xyz-abc-123,O=ABC,C=GB',
),
);
The text was updated successfully, but these errors were encountered: