Authenticating against Couchbase Server
As well as Role-Based Access Control (RBAC), Couchbase offers connection with Certificate Authentication, and works transparently with LDAP.
Our Getting Started guide covered the basics for authorizing against a Couchbase cluster, but you may need to use alternative authentication methods such as Certification.
RBAC
Our Getting Started guide introduced basic authentication against a Couchbase cluster:
var cluster = await couchbase.connect('couchbase://localhost', {
username: 'Administrator',
password: 'password',
})
Unresolved include directive in modules/howtos/pages/sdk-authentication.adoc - include::7.0@sdk:shared:partial$auth-overview.adoc[]
Unresolved include directive in modules/howtos/pages/sdk-authentication.adoc - include::7.0@sdk:shared:partial$auth-overview.adoc[]
Authenticating a Node.js Client by Certificate
For sample procedures whereby certificates can be generated and deployed, see Manage Certificates. The rest of this document assumes that the processes there, or something similar, have been followed. That is, a cluster certificate has been created and installed on the server, a client certificate has been created, and it is stored in a JVM keystore along with the cluster’s certificate.
cluster = await couchbase.connect('couchbase://localhost', {
authenticator: new couchbase.CertificateAuthenticator(
'/path/to/client/certificate.pem',
'/path/to/client/key.pem'
),
trustStorePath: '/path/to/ca/certificates.pem',
})
Unresolved include directive in modules/howtos/pages/sdk-authentication.adoc - include::7.0@sdk:shared:partial$auth-overview.adoc[]