[CDRIVER-2425] authSource option from TXT record ignored Created: 12/Dec/17  Updated: 28/Oct/23  Resolved: 14/Dec/17

Status: Closed
Project: C Driver
Component/s: auth, libmongoc
Affects Version/s: 1.9.0
Fix Version/s: 1.9.0

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DRIVERS-431 Test with authentication and mongodb+... Closed
Related
related to CDRIVER-3328 Provide a way to access the URI updat... Closed
is related to CDRIVER-2426 Make fewer copies of the MongoDB URI Backlog

 Description   

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.



 Comments   
Comment by Githook User [ 16/Dec/17 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: CDRIVER-2425 test authsource from TXT record
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/51665d0fa9ea885448f81e87a98524ae3c512b3b

Comment by Githook User [ 14/Dec/17 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: CDRIVER-2425 authSource from TXT record is ignored
Branch: r1.9
https://github.com/mongodb/mongo-c-driver/commit/4df4560584886d55d95a1e3ef8308bc2be18e3a3

Comment by Githook User [ 14/Dec/17 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: CDRIVER-2425 authSource from TXT record is ignored
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/7887ae59655633f91395cc5978efd3357a0f774f

Generated at Wed Feb 07 21:15:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.