Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-8784

Add authSource=admin to Drivers connection examples

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: drivers
    • Environment:
    • 0.25

      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

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            andrew.davidson@mongodb.com Andrew Davidson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              7 years, 33 weeks, 3 days ago