Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-1445

Authentication fails when using App.Config with IAuthenticator

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.6
    • Fix Version/s: 2.4.8
    • Component/s: library
    • Labels:
      None

      Description

      From https://forums.couchbase.com/t/perhaps-a-bug-with-new-couchbase-5-passwordauthenticator/13126

      When I initiate cluster configuration using app.config. In this case, I cannot open a bucket using authenticator. However, if I run almost identical code, where I create new cluster and only set server list for it, everything is working as expected and I can open a bucket with correct credentials.

      How to replicate (code that produces exception):

      Cluster cluster = new Cluster(configurationSectionName: "couchbaseClients/couchbase"); var auth = new Couchbase.Authentication.PasswordAuthenticator(userName, password); cluster.Authenticate(auth); return cluster.OpenBucket(bucketName);

      Exceptions:
      "Could not bootstrap - check inner exceptions for details."
      "One or more errors occurred."

      The same bucket and the same credentials can open a bucket successfully if initialized like this:

      Cluster cluster = new Cluster( new Couchbase.Configuration.Client.ClientConfiguration() { //Servers = _Cluster.Configuration.Servers - it works too, here _Cluster is initialized using app.config Servers = new List<Uri> { new Uri("http://xxx.xxx.xxx.xxxx:8091") } } ); var auth = new Couchbase.Authentication.PasswordAuthenticator(userName, password); cluster.Authenticate(auth);

      App.config related to couchbase is:

      <configSections> <sectionGroup name="couchbaseClients"> <section name="couchbase" type="Couchbase.Configuration.Client.Providers.CouchbaseClientSection, Couchbase.NetClient" /> </sectionGroup> </configSections> <couchbaseClients> <couchbase useSsl="false"> <servers> <add uri="http://xxx.xxx.xxx.xxx:8091"></add> </servers> <buckets> <add name="xxxxx" password="*******"> <connectionPool name="custom" maxSize="10" minSize="5" sendTimeout="12000">< /connectionPool> </add> </buckets> </couchbase> </couchbaseClients>

       

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              mike.goldsmith Michael Goldsmith
              Reporter:
              jmorris Jeff Morris
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.