Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2425

authSource option from TXT record ignored

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.9.0
    • Affects Version/s: 1.9.0
    • Component/s: auth, libmongoc
    • None

      Given a URI like this:

      mongodb+srv://user:pass@hostname/test

      If there is a TXT record for hostname like "authSource=admin", then the driver should log into the admin database, not the URI's database "test". However, the authSource from the TXT record is ignored.

      Cause: when we create a client or client pool, we call mongoc_topology_new, which copies the client's URI to the topology's URI, then updates the topology's URI with the contents of the SRV and TXT records. But then we create a "cluster" using the client's URI, which hasn't been updated.

      This is going to be a bug factory so I'll open a ticket to clean it up and test it better. Meanwhile, just initialize the cluster with the topology's URI, not the client's.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: