From 5fcd184275d301a057c222c6b2f1fecc2a135c62 Mon Sep 17 00:00:00 2001 From: Michael Morisi Date: Mon, 12 Aug 2024 14:24:14 -0400 Subject: [PATCH 1/2] Change username and password copy --- source/connection-troubleshooting.txt | 6 +-- source/fundamentals/authentication.txt | 12 +++--- .../connection/network-compression.txt | 2 +- source/fundamentals/connection/tls.txt | 6 +-- .../enterprise-authentication.txt | 38 +++++++++---------- source/quick-start.txt | 6 +-- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/source/connection-troubleshooting.txt b/source/connection-troubleshooting.txt index 50c2572b..afac9f26 100644 --- a/source/connection-troubleshooting.txt +++ b/source/connection-troubleshooting.txt @@ -84,7 +84,7 @@ driver might raise an error message similar to one of the following messages: :copyable: false Authentication failed","attr":{"mechanism":"SCRAM-SHA-256","principalName": - "","":"","client":"127.0.0.1:2012", + "","":"","client":"127.0.0.1:2012", "result":"UserNotFound: Could not find user}} .. code-block:: none @@ -161,7 +161,7 @@ driver to use ``users`` as the authentication database: using MongoDB.Driver; // Connection URI - const string connectionUri = "mongodb://:@:/?authSource=users"; + const string connectionUri = "mongodb://:@:/?authSource=users"; // Create a new client and connect to the server var client = new MongoClient(connectionUri); @@ -317,7 +317,7 @@ You can set this option on the connection string. The following example sets using MongoDB.Driver; // Connection URI - const string connectionUri = "mongodb://:@:/?connectTimeoutMS=10000"; + const string connectionUri = "mongodb://:@:/?connectTimeoutMS=10000"; // Create a new client and connect to the server var client = new MongoClient(connectionUri); diff --git a/source/fundamentals/authentication.txt b/source/fundamentals/authentication.txt index dd7e5129..5ab13367 100644 --- a/source/fundamentals/authentication.txt +++ b/source/fundamentals/authentication.txt @@ -57,8 +57,8 @@ Mechanisms The following examples contain code examples that use the following placeholders: -- ```` - MongoDB username. -- ```` - MongoDB user's password. +- ```` - MongoDB username. +- ```` - MongoDB user's password. - ```` - network address of the MongoDB server, accessible by your client. - ```` - port number of the MongoDB server. - ```` - MongoDB database that contains the user's authentication @@ -92,14 +92,14 @@ see the corresponding syntax for specifying the default authentication mechanism .. code-block:: csharp - var mongoClient = new MongoClient("mongodb://:@:/?authSource="); + var mongoClient = new MongoClient("mongodb://:@:/?authSource="); .. tab:: MongoCredential :tabid: default-mongo-credential .. code-block:: csharp - var credential = MongoCredential.CreateCredential("", "", ""); + var credential = MongoCredential.CreateCredential("", "", ""); var settings = MongoClientSettings.FromConnectionString(""); settings.Credential = credential; var mongoClient = new MongoClient(settings); @@ -118,7 +118,7 @@ string as follow: .. code-block:: csharp - var mongoClient = new MongoClient("mongodb://:@:/?authSource=&authMechanism=SCRAM-SHA-256"); + var mongoClient = new MongoClient("mongodb://:@:/?authSource=&authMechanism=SCRAM-SHA-256"); .. tip:: Default Mechanism @@ -141,7 +141,7 @@ string as follow: .. code-block:: csharp - var mongoClient = new MongoClient("mongodb://:@:/?authSource=&authMechanism=SCRAM-SHA-1"); + var mongoClient = new MongoClient("mongodb://:@:/?authSource=&authMechanism=SCRAM-SHA-1"); .. tip:: Default Mechanism diff --git a/source/fundamentals/connection/network-compression.txt b/source/fundamentals/connection/network-compression.txt index f49dc77c..912d4a85 100644 --- a/source/fundamentals/connection/network-compression.txt +++ b/source/fundamentals/connection/network-compression.txt @@ -44,7 +44,7 @@ specify the algorithms you want to use in one of the following ways: :emphasize-lines: 2 const string connectionUri = - "mongodb+srv://:@/?compressors=snappy,zlib,zstd"; + "mongodb+srv://:@/?compressors=snappy,zlib,zstd"; var client = new MongoClient(connectionUri); diff --git a/source/fundamentals/connection/tls.txt b/source/fundamentals/connection/tls.txt index 0496ffe1..4b29757b 100644 --- a/source/fundamentals/connection/tls.txt +++ b/source/fundamentals/connection/tls.txt @@ -61,7 +61,7 @@ on a ``MongoClientSettings`` object or through a parameter in your connection st .. code-block:: csharp - var mongoClient = new MongoClient("mongodb://:@:?tls=true"); + var mongoClient = new MongoClient("mongodb://:@:?tls=true"); Configure a Client Certificate ------------------------------ @@ -135,7 +135,7 @@ You can allow insecure TLS in two different ways: using a property on a .. code-block:: csharp - var mongoClient = new MongoClient("mongodb://:@:?tls=true&tlsInsecure=true"); + var mongoClient = new MongoClient("mongodb://:@:?tls=true&tlsInsecure=true"); .. warning:: @@ -183,7 +183,7 @@ revoked before it connects. You can enable revocation checking using either .. code-block:: csharp - var mongoClient = new MongoClient("mongodb://:@:?tls=true&tlsDisableCertificateRevocationCheck=false"); + var mongoClient = new MongoClient("mongodb://:@:?tls=true&tlsDisableCertificateRevocationCheck=false"); .. note:: diff --git a/source/fundamentals/enterprise-authentication.txt b/source/fundamentals/enterprise-authentication.txt index 9c90063f..fd41a540 100644 --- a/source/fundamentals/enterprise-authentication.txt +++ b/source/fundamentals/enterprise-authentication.txt @@ -51,8 +51,8 @@ user to authenticate to a Kerberos service using the user's principal name. The following examples specify the authentication mechanism using the following placeholders: -- ````: Your :wikipedia:`URL-encoded ` principal name; for example "username%40REALM.ME" -- ````: Your Kerberos user's password +- ````: Your :wikipedia:`URL-encoded ` principal name; for example "username%40REALM.ME" +- ````: Your Kerberos user's password - ````: The network address of your MongoDB server, accessible by your client Select the :guilabel:`Connection String` or :guilabel:`MongoCredential` tab to @@ -66,7 +66,7 @@ mechanism: .. code-block:: csharp - var mongoClient = new MongoClient("mongodb://:@/?authMechanism=GSSAPI"); + var mongoClient = new MongoClient("mongodb://:@/?authMechanism=GSSAPI"); .. tab:: MongoCredential :tabid: mongo-credential @@ -74,7 +74,7 @@ mechanism: .. code-block:: csharp :emphasize-lines: 1 - var credential = MongoCredential.CreateGssapiCredential("", ""); + var credential = MongoCredential.CreateGssapiCredential("", ""); var settings = MongoClientSettings.FromConnectionString(""); settings.Credential = credential; var mongoClient = new MongoClient(settings); @@ -108,7 +108,7 @@ qualified domain name of the host: .. code-block:: csharp - var mongoClient = new MongoClient("mongodb://:@/?authMechanism=GSSAPI&authMechanismProperties=CANONICALIZE_HOSTNAME:true"); + var mongoClient = new MongoClient("mongodb://:@/?authMechanism=GSSAPI&authMechanismProperties=CANONICALIZE_HOSTNAME:true"); .. tab:: MongoCredential :tabid: mongo-credential @@ -116,7 +116,7 @@ qualified domain name of the host: .. code-block:: csharp :emphasize-lines: 1, 2 - var credential = MongoCredential.CreateGssapiCredential("", ""); + var credential = MongoCredential.CreateGssapiCredential("", ""); credential = credential.WithMechanismProperty("CANONICALIZE_HOST_NAME", "true"); var settings = MongoClientSettings.FromConnectionString(""); @@ -136,7 +136,7 @@ from the service's realm: .. code-block:: csharp - var mongoClient = new MongoClient("mongodb://:@/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_REALM:"); + var mongoClient = new MongoClient("mongodb://:@/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_REALM:"); .. tab:: MongoCredential :tabid: mongo-credential @@ -144,7 +144,7 @@ from the service's realm: .. code-block:: csharp :emphasize-lines: 1, 2 - var credential = MongoCredential.CreateGssapiCredential("", ""); + var credential = MongoCredential.CreateGssapiCredential("", ""); credential = credential.WithMechanismProperty("SERVICE_REALM", ""); var settings = MongoClientSettings.FromConnectionString(""); @@ -164,7 +164,7 @@ default ``mongodb``: .. code-block:: csharp - var mongoClient = new MongoClient("mongodb://:@/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:"); + var mongoClient = new MongoClient("mongodb://:@/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:"); .. tab:: MongoCredential :tabid: mongo-credential @@ -172,7 +172,7 @@ default ``mongodb``: .. code-block:: csharp :emphasize-lines: 1, 2 - var credential = MongoCredential.CreateGssapiCredential("", ""); + var credential = MongoCredential.CreateGssapiCredential("", ""); credential = credential.WithMechanismProperty("SERVICE_NAME", ""); var settings = MongoClientSettings.FromConnectionString(""); @@ -192,7 +192,7 @@ properties: .. code-block:: csharp - var mongoClient = new MongoClient("mongodb://:@/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:,SERVICE_REALM:"); + var mongoClient = new MongoClient("mongodb://:@/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:,SERVICE_REALM:"); .. tab:: MongoCredential :tabid: mongo-credential @@ -200,7 +200,7 @@ properties: .. code-block:: csharp :emphasize-lines: 2, 3 - var credential = MongoCredential.CreateGssapiCredential("", ""); + var credential = MongoCredential.CreateGssapiCredential("", ""); credential = credential.WithMechanismProperty("SERVICE_REALM", "") .WithMechanismProperty("SERVICE_NAME", ""); @@ -219,8 +219,8 @@ using your directory-server username and password. The following examples specify the authentication mechanism using the following placeholders: -- ````: Your LDAP username -- ````: Your LDAP password +- ````: Your LDAP username +- ````: Your LDAP password - ````: The network address of your MongoDB server, accessible by your client - ````: The MongoDB database that contains your user's @@ -237,7 +237,7 @@ mechanism: .. code-block:: csharp - var mongoClient = new MongoClient("mongodb://:@/?authSource=&authMechanism=PLAIN"); + var mongoClient = new MongoClient("mongodb://:@/?authSource=&authMechanism=PLAIN"); .. tab:: MongoCredential :tabid: mongo-credential @@ -245,7 +245,7 @@ mechanism: .. code-block:: csharp :emphasize-lines: 1 - var credential = MongoCredential.CreatePlainCredential("", "", ""); + var credential = MongoCredential.CreatePlainCredential("", "", ""); var settings = MongoClientSettings.FromConnectionString(""); settings.Credential = credential; var mongoClient = new MongoClient(settings); @@ -304,7 +304,7 @@ see the corresponding syntax. .. code-block:: csharp - var connectionString = "mongodb://@[:]/?" + + var connectionString = "mongodb://@[:]/?" + "authMechanism=MONGODB-OIDC" + "&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:"); var mongoClientSettings = MongoClientSettings.FromConnectionString(connectionString); @@ -314,7 +314,7 @@ see the corresponding syntax. :tabid: mongodb-azure-mongo-credential The following code example shows how to specify Azure IMDS OIDC authentication. - Replace the ```` placeholder with the client ID or application ID of the + Replace the ```` placeholder with the client ID or application ID of the Azure managed identity or enterprise application. Replace the ```` placeholder with the value of the ``audience`` parameter configured on your MongoDB deployment. @@ -323,7 +323,7 @@ see the corresponding syntax. var mongoClientSettings = MongoClientSettings.FromConnectionString( "mongodb+srv://[:]"); - mongoClientSettings.Credential = MongoCredential.CreateOidcCredential("azure", "") + mongoClientSettings.Credential = MongoCredential.CreateOidcCredential("azure", "") .WithMechanismProperty("TOKEN_RESOURCE", ""); var client = new MongoClient(mongoClientSettings); diff --git a/source/quick-start.txt b/source/quick-start.txt index 25c1b463..96690d2c 100644 --- a/source/quick-start.txt +++ b/source/quick-start.txt @@ -35,7 +35,7 @@ a connection string similar to the following in your copy buffer: .. code-block:: bash - "mongodb+srv://:@cluster0.abc.mongodb.net/?retryWrites=true&w=majority" + "mongodb+srv://:@cluster0.abc.mongodb.net/?retryWrites=true&w=majority" Set Your Connection String ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -60,8 +60,8 @@ code. .. important:: - Make sure to replace the ```` and ```` sections of the connection - string with the username and password of your Atlas user. + Make sure to replace the ```` and ```` sections of the connection + string with the username and password of your Atlas database user. For more information about connection strings, see :manual:`Connection Strings `. From 540ac5ba6a15dcdebc07e73fc53150f3af3541bc Mon Sep 17 00:00:00 2001 From: Michael Morisi Date: Mon, 12 Aug 2024 15:15:36 -0400 Subject: [PATCH 2/2] Address NR feedback --- .../fundamentals/enterprise-authentication.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/fundamentals/enterprise-authentication.txt b/source/fundamentals/enterprise-authentication.txt index fd41a540..fdc07b44 100644 --- a/source/fundamentals/enterprise-authentication.txt +++ b/source/fundamentals/enterprise-authentication.txt @@ -51,8 +51,8 @@ user to authenticate to a Kerberos service using the user's principal name. The following examples specify the authentication mechanism using the following placeholders: -- ````: Your :wikipedia:`URL-encoded ` principal name; for example "username%40REALM.ME" -- ````: Your Kerberos user's password +- ````: Your :wikipedia:`URL-encoded ` principal name; for example "username%40REALM.ME" +- ````: Your Kerberos user's password - ````: The network address of your MongoDB server, accessible by your client Select the :guilabel:`Connection String` or :guilabel:`MongoCredential` tab to @@ -66,7 +66,7 @@ mechanism: .. code-block:: csharp - var mongoClient = new MongoClient("mongodb://:@/?authMechanism=GSSAPI"); + var mongoClient = new MongoClient("mongodb://:@/?authMechanism=GSSAPI"); .. tab:: MongoCredential :tabid: mongo-credential @@ -74,7 +74,7 @@ mechanism: .. code-block:: csharp :emphasize-lines: 1 - var credential = MongoCredential.CreateGssapiCredential("", ""); + var credential = MongoCredential.CreateGssapiCredential("", ""); var settings = MongoClientSettings.FromConnectionString(""); settings.Credential = credential; var mongoClient = new MongoClient(settings); @@ -219,8 +219,8 @@ using your directory-server username and password. The following examples specify the authentication mechanism using the following placeholders: -- ````: Your LDAP username -- ````: Your LDAP password +- ````: Your LDAP username +- ````: Your LDAP password - ````: The network address of your MongoDB server, accessible by your client - ````: The MongoDB database that contains your user's @@ -237,7 +237,7 @@ mechanism: .. code-block:: csharp - var mongoClient = new MongoClient("mongodb://:@/?authSource=&authMechanism=PLAIN"); + var mongoClient = new MongoClient("mongodb://:@/?authSource=&authMechanism=PLAIN"); .. tab:: MongoCredential :tabid: mongo-credential @@ -245,7 +245,7 @@ mechanism: .. code-block:: csharp :emphasize-lines: 1 - var credential = MongoCredential.CreatePlainCredential("", "", ""); + var credential = MongoCredential.CreatePlainCredential("", "", ""); var settings = MongoClientSettings.FromConnectionString(""); settings.Credential = credential; var mongoClient = new MongoClient(settings);