Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-339

Couchbase java client ignores provided username and always use bucket as username during HTTP authorization step

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Blocker
    • None
    • 1.1.8
    • Core
    • Security Level: Public
    • None
    • Server: CentOS 2.6.32 x86_64, Client: MacOS Darwin 12.4.0, Java 1.6

    Description

      new CouchbaseClient(servers, "default", "username", "password") doesn't honor provided username and always use bucket as username during HTTP authorization step.

      Outgoing request is:
      FINE: sun.net.www.MessageHeader@658f73867 pairs:

      {GET /pools HTTP/1.1: null} {Accept: application/json} {user-agent: Couchbase Java Client} {X-memcachekv-Store-Client-Specification-Version: 1.0} {Authorization: Basic ZGVmYXVsdDpwYXNzd29yZA==} {Host: 192.168.1.79:8091} {Connection: keep-alive}

      Text value of Authorization header corresponds to "Basic default:password", while it should be "Basic username:password"

      Therefore 401 unauthorized response received:
      sun.net.www.MessageHeader@92f1bf07 pairs:

      {null: HTTP/1.1 401 Unauthorized} {WWW-Authenticate: Basic realm="Couchbase Server Admin / REST"} {Server: Couchbase Server 2.1.0-718-rel-enterprise} {Pragma: no-cache} {Date: Wed, 31 Jul 2013 13:10:21 GMT} {Content-Length: 0} {Cache-Control: no-cache}

      The actual bug hides at line #131 of method com.couchbase.client.CouchbaseConnectionFactoryBuilder.buildCouchbaseConnection(final List<URI> baseList, final String bucketName, final String usr, final String pwd), wher usr parameter is not used anyhow and just ignored

      Or see it at:
      https://github.com/couchbase/couchbase-java-client/blob/master/src/main/java/com/couchbase/client/CouchbaseConnectionFactoryBuilder.java#L131

      Attachments

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

        Activity

          People

            daschl Michael Nitschinger
            sergey.bushik Sergey Bushik
            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