@@ -369,6 +369,56 @@ see the corresponding syntax.
369
369
:start-after: start-oidc-azure-mongo-cred
370
370
:end-before: end-oidc-azure-mongo-cred
371
371
372
+ .. _kotlin-mongodb-oidc-gcp-imds:
373
+
374
+ GCP IMDS
375
+ ~~~~~~~~
376
+
377
+ If your application runs on a Google Compute Engine VM, or otherwise uses the
378
+ `GCP Instance Metadata Service <https://cloud.google.com/compute/docs/metadata/querying-metadata>`__,
379
+ you can authenticate to MongoDB by using the {+driver-short+}'s built-in GCP
380
+ support.
381
+
382
+ You can specify GCP IMDS OIDC authentication either by
383
+ using a ``MongoCredential`` instance or by specifying your credentials
384
+ in the connection string.
385
+
386
+ Select from the :guilabel:`Connection String` or :guilabel:`MongoCredential` tabs to
387
+ see the corresponding syntax.
388
+
389
+ .. tabs::
390
+
391
+ .. tab:: Connection String
392
+ :tabid: mongodb-gcp-imds-connection-string
393
+
394
+ Replace the ``<percent-encoded audience>`` placeholder in the
395
+ following code with the percent-encoded value of the audience server
396
+ parameter configured on your MongoDB deployment.
397
+
398
+ The comma (``,``) character and its encoding (``%2C``) are
399
+ reserved, and using these characters in a value causes the
400
+ driver to interpret commas as delimiters of key-value pairs.
401
+ You must specify values that contain commas in a ``MongoCredential`` instance, as
402
+ demonstrated in the :guilabel:`MongoCredential` tab.
403
+
404
+ .. literalinclude:: /includes/security/enterprise-auth.kt
405
+ :language: kotlin
406
+ :dedent:
407
+ :start-after: start-oidc-gcp-connect-str
408
+ :end-before: end-oidc-gcp-connect-str
409
+
410
+ .. tab:: MongoCredential
411
+ :tabid: mongodb-gcp-mongo-credential
412
+
413
+ Replace the ``<audience>`` placeholder with the value of the
414
+ ``audience`` server parameter configured on your MongoDB deployment.
415
+
416
+ .. literalinclude:: /includes/security/enterprise-auth.kt
417
+ :language: kotlin
418
+ :dedent:
419
+ :start-after: start-oidc-gcp-mongo-cred
420
+ :end-before: end-oidc-gcp-mongo-cred
421
+
372
422
.. _kotlin-sync-auth-kubernetes:
373
423
374
424
Kubernetes
@@ -425,56 +475,6 @@ Select from the :guilabel:`Connection String` or
425
475
.credential(credential)
426
476
.build())
427
477
428
- .. _kotlin-mongodb-oidc-gcp-imds:
429
-
430
- GCP IMDS
431
- ~~~~~~~~
432
-
433
- If your application runs on a Google Compute Engine VM, or otherwise uses the
434
- `GCP Instance Metadata Service <https://cloud.google.com/compute/docs/metadata/querying-metadata>`__,
435
- you can authenticate to MongoDB by using the {+driver-short+}'s built-in GCP
436
- support.
437
-
438
- You can specify GCP IMDS OIDC authentication either by
439
- using a ``MongoCredential`` instance or by specifying your credentials
440
- in the connection string.
441
-
442
- Select from the :guilabel:`Connection String` or :guilabel:`MongoCredential` tabs to
443
- see the corresponding syntax.
444
-
445
- .. tabs::
446
-
447
- .. tab:: Connection String
448
- :tabid: mongodb-gcp-imds-connection-string
449
-
450
- Replace the ``<percent-encoded audience>`` placeholder in the
451
- following code with the percent-encoded value of the audience server
452
- parameter configured on your MongoDB deployment.
453
-
454
- The comma (``,``) character and its encoding (``%2C``) are
455
- reserved, and using these characters in a value causes the
456
- driver to interpret commas as delimiters of key-value pairs.
457
- You must specify values that contain commas in a ``MongoCredential`` instance, as
458
- demonstrated in the :guilabel:`MongoCredential` tab.
459
-
460
- .. literalinclude:: /includes/security/enterprise-auth.kt
461
- :language: kotlin
462
- :dedent:
463
- :start-after: start-oidc-gcp-connect-str
464
- :end-before: end-oidc-gcp-connect-str
465
-
466
- .. tab:: MongoCredential
467
- :tabid: mongodb-gcp-mongo-credential
468
-
469
- Replace the ``<audience>`` placeholder with the value of the
470
- ``audience`` server parameter configured on your MongoDB deployment.
471
-
472
- .. literalinclude:: /includes/security/enterprise-auth.kt
473
- :language: kotlin
474
- :dedent:
475
- :start-after: start-oidc-gcp-mongo-cred
476
- :end-before: end-oidc-gcp-mongo-cred
477
-
478
478
Custom Callback
479
479
~~~~~~~~~~~~~~~
480
480
0 commit comments