Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If you want to specify your own parser you can override the default parser as follows: #95

Open
thomascouto opened this issue Sep 8, 2021 · 1 comment

Comments

@thomascouto
Copy link

From DOC:

If you want to specify your own parser you can override the default parser as follows:

const ad = new ActiveDirectory({ url: 'ldap://dc.domain.com',
                               baseDN: 'dc=domain,dc=com',
                               username: '[email protected]',
                               password: 'password',
                               attributes: {
                                   user: ['dn']
                              }      
});

I get the error:

Type '["dn"]' is not assignable to type '["dn", "distinguishedName", "userPrincipalName", "sAMAccountName", "mail", "lockoutTime", "whenCreated", "pwdLastSet", "userAccountControl", "employeeID", "sn", "givenName", ... 4 more ..., "description"]'.

Is it a bug ? Thanks

@dvaghela
Copy link

dvaghela commented Jan 28, 2022

I think you might be using the Types from @types/activedirectory2.
It has loaded some types by default and prevents such overriding.

Two options:

  1. If you can, just remove the @types/activedirectoy2 package from your project and try again.
    You won't get the typings but such overriding will work.
  2. Just add the attribute you are looking for in the index file (where the attributes are defined) of the @types/activedirectory2 package in your node_modules folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants