@@ -445,19 +445,30 @@ Windows
445
445
446
446
.. code-block:: python
447
447
448
+ <<<<<<< HEAD
448
449
client = pymongo.MongoClient("mongodb://<hostname>:<port>",
449
450
username="<db_username>",
450
451
authMechanism="GSSAPI",
451
452
password="<db_password>",
452
453
authMechanismProperties="SERVICE_NAME:<authentication service name>,
453
454
CANONICALIZE_HOST_NAME:true,
454
455
SERVICE_REALM:<service realm>")
456
+ =======
457
+ client = pymongo.MongoClient("mongodb://<hostname>:<port>",
458
+ username="<username>",
459
+ authMechanism="GSSAPI",
460
+ password="<password>",
461
+ authMechanismProperties="SERVICE_NAME:<authentication service name>,
462
+ CANONICALIZE_HOST_NAME:true,
463
+ SERVICE_REALM:<service realm>")
464
+ >>>>>>> fc4211c (DOCSP-48719: Update non-Mongo credential placeholders (#240))
455
465
456
466
.. tab:: Connection String
457
467
:tabid: connectionstring
458
468
459
469
.. code-block:: python
460
470
471
+ <<<<<<< HEAD
461
472
uri = ("mongodb://<percent-encoded username>:<percent-encoded user password>"
462
473
"@<hostname>:<port>/?"
463
474
"&authMechanism=GSSAPI"
@@ -466,6 +477,43 @@ Windows
466
477
"CANONICALIZE_HOST_NAME:true,"
467
478
"SERVICE_REALM:<service realm>")
468
479
client = pymongo.MongoClient(uri)
480
+ =======
481
+ uri = ("mongodb://<percent-encoded username>:<percent-encoded user password>"
482
+ "@<hostname>:<port>/?"
483
+ "&authMechanism=GSSAPI"
484
+ "&authMechanismProperties="
485
+ "SERVICE_NAME:<authentication service name>,"
486
+ "CANONICALIZE_HOST_NAME:true,"
487
+ "SERVICE_REALM:<service realm>")
488
+ client = pymongo.MongoClient(uri)
489
+
490
+ .. tab:: MongoClient (Asynchronous)
491
+ :tabid: mongoclient-async
492
+
493
+ .. code-block:: python
494
+
495
+ client = pymongo.AsyncMongoClient("mongodb://<hostname>:<port>",
496
+ username="<username>",
497
+ authMechanism="GSSAPI",
498
+ password="<password>",
499
+ authMechanismProperties="SERVICE_NAME:<authentication service name>,
500
+ CANONICALIZE_HOST_NAME:true,
501
+ SERVICE_REALM:<service realm>")
502
+
503
+ .. tab:: Connection String (Asynchronous)
504
+ :tabid: connectionstring-async
505
+
506
+ .. code-block:: python
507
+
508
+ uri = ("mongodb://<percent-encoded username>:<percent-encoded user password>"
509
+ "@<hostname>:<port>/?"
510
+ "&authMechanism=GSSAPI"
511
+ "&authMechanismProperties="
512
+ "SERVICE_NAME:<authentication service name>,"
513
+ "CANONICALIZE_HOST_NAME:true,"
514
+ "SERVICE_REALM:<service realm>")
515
+ client = pymongo.AsyncMongoClient(uri)
516
+ >>>>>>> fc4211c (DOCSP-48719: Update non-Mongo credential placeholders (#240))
469
517
470
518
To learn more about authenticating with Kerberos, see
471
519
:ref:`pymongo-kerberos` in the Enterprise Authentication guide.
@@ -485,8 +533,8 @@ PLAIN SASL
485
533
.. code-block:: python
486
534
487
535
client = pymongo.MongoClient("mongodb://<hostname>:<port>",
488
- username="<db_username >",
489
- password="<db_password >",
536
+ username="<username >",
537
+ password="<password >",
490
538
authMechanism="PLAIN",
491
539
tls=True)
492
540
@@ -495,7 +543,7 @@ PLAIN SASL
495
543
496
544
.. code-block:: python
497
545
498
- uri = ("mongodb://<db_username >:<db_password >@<hostname>:<port>/?"
546
+ uri = ("mongodb://<username >:<password >@<hostname>:<port>/?"
499
547
"&authMechanism=PLAIN"
500
548
"&tls=true")
501
549
client = pymongo.MongoClient(uri)
0 commit comments