[DOCS-8784] Add authSource=admin to Drivers connection examples Created: 07/Sep/16  Updated: 02/Nov/16  Resolved: 21/Sep/16

Status: Closed
Project: Documentation
Component/s: drivers
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Andrew Davidson Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Location: https://docs.atlas.mongodb.com/driver-connection/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36
Screen Resolution: 1920 x 1080


Issue Links:
Duplicate
is duplicated by DOCS-8819 Comment on: "MongoDB Atlas/driver-con... Closed
Participants:
Days since reply: 7 years, 22 weeks, 2 days ago
Story Points: 0.25

 Description   

Since all MongoDB Atlas users authenticate against the admin DB, it behooves us to elaborate on our drivers examples to show connections to a database namespace other than admin but with &authSource=admin at the end.

In other words, replace
"mongodb://kay:myRealPassword@mycluster0-shard-00-00-wpeiv.mongodb.net:27017,mycluster0-shard-00-01-wpeiv.mongodb.net:27017,mycluster0-shard-00-02-wpeiv.mongodb.net:27017/admin?replicaSet=Mycluster0-shard-0&ssl=true"

with
"mongodb://kay:myRealPassword@mycluster0-shard-00-00-wpeiv.mongodb.net:27017,mycluster0-shard-00-01-wpeiv.mongodb.net:27017,mycluster0-shard-00-02-wpeiv.mongodb.net:27017/someDatabase?replicaSet=Mycluster0-shard-0&ssl=true&authSource=admin"

This is important for anyone who uses our driver connection examples but wants to connect to a database other than "admin" – they will need to more than replace the existing "admin" string with their desired database, but instead need to add the authSource=admin param, so we should just always show it



 Comments   
Comment by Andrew Davidson [ 12/Sep/16 ]

Considering not all drivers handle this the same way (some require the client be created using the standard URI after which you change the database name), e.g. Python:
http://api.mongodb.com/python/current/examples/authentication.html#delegated-authentication

We should consider how best to explain this dynamic in the Atlas connection docs (or even show an example of using delegated authentication for each driver using its own syntax in the Atlas docs).

Generated at Thu Feb 08 07:56:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.