
Security News
Potemkin Understanding in LLMs: New Study Reveals Flaws in AI Benchmarks
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
ldap-authentication
Advanced tools
This library use ldapjs
as the underneath library. It has two modes of authentications:
If an admin user is provided, the library will login (ldap bind) with the admin user, then search for the user to be authenticated, get its DN (distinguish name), then use the user DN and password to login again. If every thing is ok, the user details will be returned.
If the admin user is not provided, then the user DN must be provided. The lib simply does a login with the user DN and password, then do a search on the user and return the user's details.
npm install ldap-authentication --save
let user = await authenticate(options)
const { authenticate } = require('ldap-authentication')
async function auth() {
// auth with admin
let options = {
ldapOpts: {
url: 'ldap://ldap.forumsys.com',
// tlsOptions: { rejectUnauthorized: false }
},
adminDn: 'cn=read-only-admin,dc=example,dc=com',
adminPassword: 'password',
userPassword: 'password',
userSearchBase: 'dc=example,dc=com',
userSearchFilter: '(uid=gauss)',
// starttls: false
}
let user = await authenticate(options)
console.log(user)
// auth with regular user
options = {
ldapOpts: {
url: 'ldap://ldap.forumsys.com',
// tlsOptions: { rejectUnauthorized: false }
},
userDn: 'uid=einstein,dc=example,dc=com',
userPassword: 'password',
userSearchBase: 'dc=example,dc=com',
userSearchFilter: '(uid=einstein)',
// starttls: false
}
user = await authenticate(options)
console.log(user)
}
auth()
ldapOpts
: This is passed to ldapjs
client directly
url
: url of the ldap server. Example: ldap://ldap.forumsys.com
tlsOptions
: options to pass to node tls. Example: { rejectUnauthorized: false }
adminDn
: The DN of the admistrator. Example: 'cn=read-only-admin,dc=example,dc=com',adminPassword
: The password of the admin.userDn
: The DN of the user to be authenticated. This is only needed if adminDn
and adminPassword
are not provided.
Example: uid=gauss,dc=example,dc=com
userPassword
: The password of the user,userSearchBase
: The ldap base DN to search the user. Example: dc=example,dc=com
usernameAttribute
: The ldap search equality attribute name corresponding to the user's username.
It will be used with the value in username
to construct an ldap filter as ({attribute}={username})
to find the user and get user details in LDAP. Example: uid
username
: The username to authenticate with. It is used together with the name in usernameAttribute
to construct an ldap filter as ({attribute}={username})
to find the user and get user details in LDAP. Example: some user input
starttls
: Boolean. Use STARTTLS
or notFAQs
A simple async nodejs library for LDAP user authentication
The npm package ldap-authentication receives a total of 5,949 weekly downloads. As such, ldap-authentication popularity was classified as popular.
We found that ldap-authentication demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.