@@ -446,12 +446,12 @@ Windows
446
446
.. code-block:: python
447
447
448
448
client = pymongo.MongoClient("mongodb://<hostname>:<port>",
449
- username="<db_username >",
450
- authMechanism="GSSAPI",
451
- password="<db_password >",
452
- authMechanismProperties="SERVICE_NAME:<authentication service name>,
453
- CANONICALIZE_HOST_NAME:true,
454
- SERVICE_REALM:<service realm>")
449
+ username="<username >",
450
+ authMechanism="GSSAPI",
451
+ password="<password >",
452
+ authMechanismProperties="SERVICE_NAME:<authentication service name>,
453
+ CANONICALIZE_HOST_NAME:true,
454
+ SERVICE_REALM:<service realm>")
455
455
456
456
.. tab:: Connection String
457
457
:tabid: connectionstring
@@ -485,8 +485,8 @@ PLAIN SASL
485
485
.. code-block:: python
486
486
487
487
client = pymongo.MongoClient("mongodb://<hostname>:<port>",
488
- username="<db_username >",
489
- password="<db_password >",
488
+ username="<username >",
489
+ password="<password >",
490
490
authMechanism="PLAIN",
491
491
tls=True)
492
492
@@ -495,11 +495,35 @@ PLAIN SASL
495
495
496
496
.. code-block:: python
497
497
498
- uri = ("mongodb://<db_username >:<db_password >@<hostname>:<port>/?"
498
+ uri = ("mongodb://<username >:<password >@<hostname>:<port>/?"
499
499
"&authMechanism=PLAIN"
500
500
"&tls=true")
501
501
client = pymongo.MongoClient(uri)
502
502
503
+ <<<<<<< HEAD
504
+ =======
505
+ .. tab:: MongoClient (Asynchronous)
506
+ :tabid: mongoclient-async
507
+
508
+ .. code-block:: python
509
+
510
+ client = pymongo.AsyncMongoClient("mongodb://<hostname>:<port>",
511
+ username="<username>",
512
+ password="<password>",
513
+ authMechanism="PLAIN",
514
+ tls=True)
515
+
516
+ .. tab:: Connection String (Asynchronous)
517
+ :tabid: connectionstring-async
518
+
519
+ .. code-block:: python
520
+
521
+ uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
522
+ "&authMechanism=PLAIN"
523
+ "&tls=true")
524
+ client = pymongo.AsyncMongoClient(uri)
525
+
526
+ >>>>>>> fc4211c (DOCSP-48719: Update non-Mongo credential placeholders (#240))
503
527
To learn more about authenticating with PLAIN SASL, see
504
528
:ref:`pymongo-sasl` in the Enterprise Authentication guide.
505
529
0 commit comments