I have an .net app where I have my connection info and bucket credentials in my app.config
I am trying to get hold of the ClusterManager, using the credentials from my config file
I can do the following to get a bucket without entering credentials.
ClusterHelper.Initialize("couchbaseClients/couchbase"); var cluster = ClusterHelper.Get(); var bucket = cluster.OpenBucket("mybucket");
I can use the credentials for this bucket to get the ClusterManager (my bucket name is the same as my bucket username)
ClusterHelper.Initialize("couchbaseClients/couchbase"); var cluster = ClusterHelper.Get(); var manager = cluster.CreateManager("mybucket", "mybucketpwd");
But I can’t find a way to get the manager without programatically providing the password to createmanager, even though the CreateManager method does have a parameterless call.
ClusterHelper.Initialize("couchbaseClients/couchbase"); var cluster = ClusterHelper.Get(); var manager = cluster.CreateManager();
This throws an exception
System.Security.Authentication.AuthenticationException occurred HResult=0x80131501 Message=No credentials found. Source=Couchbase.NetClient
Is there a way of achieving this? I dont have a problem providing the bucket name (or username) as a parameter, since it’s a constant in my code. I guess I could traverse the config xml and get the password I need, but it seems like a clumsy solution.
I’m using Couchbase 5.0.0 and CouchbaseNetClient 2.5.2
and my config section looks like this
<couchbaseClients> <couchbase useSsl="false"> <servers> <add uri="http://localhost:8091/pools"></add> </servers> <buckets> <add name="mybucket" password="mybucketpwd" /> <!--etc--> </buckets> </couchbase> </couchbaseClients>
Thanks in advance