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
Autoconfiguration for Couchbase driver with RBAC on server side fails. After providing the following configuration:
spring:
couchbase:
bootstrap-hosts:
- 127.0.0.1:8091
username: test
password: super_secret
bucket:
name: test
I get the error below:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.couchbase.client.java.cluster.ClusterInfo]: Factory method 'couchbaseClusterInfo' threw exception; nested exception is com.couchbase.client.java.error.InvalidPasswordException
I think the problem lies in the fact that CouchbaseConfiguration.couchbaseClusterInfo() passes bucket level credentials to CouchbaseCluster's clusterManager(String username, String password). The javadoc for this method explicitly states:
Provides access to the ClusterManager to perform cluster-wide operations. Note that the credentials provided here are different from bucket-level credentials. As a rule of thumb, the "Administrator" credentials need to be passed in here or any credentials with enough permissions to perform the underlying operations. Bucket level credentials will not work.
In CouchbaseConfiguration.couchbaseCluster() we check whether RBAC is used and then we authenticate:
Hey,
Autoconfiguration for Couchbase driver with RBAC on server side fails. After providing the following configuration:
I get the error below:
I think the problem lies in the fact that
CouchbaseConfiguration.couchbaseClusterInfo()
passes bucket level credentials toCouchbaseCluster
'sclusterManager(String username, String password)
. The javadoc for this method explicitly states:In
CouchbaseConfiguration.couchbaseCluster()
we check whether RBAC is used and then we authenticate:This would mean that we can safely use
couchbaseCluster().clusterManager().info()
insidecouchbaseClusterInfo()
if RBAC is enabled.I am happy to raise a PR for this change if that would help.
Thanks!
The text was updated successfully, but these errors were encountered: