Overview
These guides show you how to authenticate to a MongoDB instance using the Node.js driver.
The Authentication Mechanisms guide contains sample connection code using each authentication mechanism supported in the MongoDB Community Edition which includes:
DEFAULTSCRAM-SHA-256SCRAM-SHA-1MONGODB-CRMONGODB-AWSX.509
The Enterprise Authentication Mechanisms guide contains sample connection code using authentication mechanisms available only in MongoDB Enterprise Edition which includes:
Kerberos (GSSAPI/SSPI)LDAP (PLAIN)MONGODB-OIDC
Note
For instructions on MongoDB driver installation and deployment setup, see our Connect to MongoDB guide. Select your MongoDB deployment type and the Node.js client.