Skip to content

Commit 366f315

Browse files
committed
DOCSP-42303: Change username and password copy (#224)
(cherry picked from commit 167830c)
1 parent 3ee3889 commit 366f315

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

source/connection-troubleshooting.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ driver might raise an error message similar to one of the following messages:
8484
:copyable: false
8585

8686
Authentication failed","attr":{"mechanism":"SCRAM-SHA-256","principalName":
87-
"<user>","<auth database>":"<user>","client":"127.0.0.1:2012",
87+
"<db_username>","<auth database>":"<db_username>","client":"127.0.0.1:2012",
8888
"result":"UserNotFound: Could not find user}}
8989

9090
.. code-block:: none
@@ -161,7 +161,7 @@ driver to use ``users`` as the authentication database:
161161
using MongoDB.Driver;
162162

163163
// Connection URI
164-
const string connectionUri = "mongodb://<username>:<password>@<hostname>:<port>/?authSource=users";
164+
const string connectionUri = "mongodb://<db_username>:<db_password>@<hostname>:<port>/?authSource=users";
165165

166166
// Create a new client and connect to the server
167167
var client = new MongoClient(connectionUri);
@@ -317,7 +317,7 @@ You can set this option on the connection string. The following example sets
317317
using MongoDB.Driver;
318318

319319
// Connection URI
320-
const string connectionUri = "mongodb://<username>:<password>@<hostname>:<port>/?connectTimeoutMS=10000";
320+
const string connectionUri = "mongodb://<db_username>:<db_password>@<hostname>:<port>/?connectTimeoutMS=10000";
321321

322322
// Create a new client and connect to the server
323323
var client = new MongoClient(connectionUri);

source/fundamentals/authentication.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ Mechanisms
5757
The following examples contain code examples that use the following
5858
placeholders:
5959

60-
- ``<username>`` - MongoDB username.
61-
- ``<password>`` - MongoDB user's password.
60+
- ``<db_username>`` - MongoDB username.
61+
- ``<db_password>`` - MongoDB user's password.
6262
- ``<hostname>`` - network address of the MongoDB server, accessible by your client.
6363
- ``<port>`` - port number of the MongoDB server.
6464
- ``<authenticationDb>`` - MongoDB database that contains the user's authentication
@@ -92,14 +92,14 @@ see the corresponding syntax for specifying the default authentication mechanism
9292

9393
.. code-block:: csharp
9494

95-
var mongoClient = new MongoClient("mongodb://<username>:<password>@<hostname>:<port>/?authSource=<authenticationDb>");
95+
var mongoClient = new MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>/?authSource=<authenticationDb>");
9696

9797
.. tab:: MongoCredential
9898
:tabid: default-mongo-credential
9999

100100
.. code-block:: csharp
101101

102-
var credential = MongoCredential.CreateCredential("<authenticationDb>", "<username>", "<password>");
102+
var credential = MongoCredential.CreateCredential("<authenticationDb>", "<db_username>", "<db_password>");
103103
var settings = MongoClientSettings.FromConnectionString("<connection string>");
104104
settings.Credential = credential;
105105
var mongoClient = new MongoClient(settings);
@@ -118,7 +118,7 @@ string as follow:
118118

119119
.. code-block:: csharp
120120

121-
var mongoClient = new MongoClient("mongodb://<username>:<password>@<hostname>:<port>/?authSource=<authenticationDb>&authMechanism=SCRAM-SHA-256");
121+
var mongoClient = new MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>/?authSource=<authenticationDb>&authMechanism=SCRAM-SHA-256");
122122

123123
.. tip:: Default Mechanism
124124

@@ -141,7 +141,7 @@ string as follow:
141141

142142
.. code-block:: csharp
143143

144-
var mongoClient = new MongoClient("mongodb://<username>:<password>@<hostname>:<port>/?authSource=<authenticationDb>&authMechanism=SCRAM-SHA-1");
144+
var mongoClient = new MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>/?authSource=<authenticationDb>&authMechanism=SCRAM-SHA-1");
145145

146146
.. tip:: Default Mechanism
147147

source/fundamentals/connection/network-compression.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ specify the algorithms you want to use in one of the following ways:
4444
:emphasize-lines: 2
4545

4646
const string connectionUri =
47-
"mongodb+srv://<user>:<password>@<cluster-url>/?compressors=snappy,zlib,zstd";
47+
"mongodb+srv://<db_username>:<db_password>@<cluster-url>/?compressors=snappy,zlib,zstd";
4848

4949
var client = new MongoClient(connectionUri);
5050

source/fundamentals/connection/tls.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ on a ``MongoClientSettings`` object or through a parameter in your connection st
6161

6262
.. code-block:: csharp
6363

64-
var mongoClient = new MongoClient("mongodb://<username>:<password>@<hostname>:<port>?tls=true");
64+
var mongoClient = new MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>?tls=true");
6565

6666
Configure a Client Certificate
6767
------------------------------
@@ -135,7 +135,7 @@ You can allow insecure TLS in two different ways: using a property on a
135135

136136
.. code-block:: csharp
137137

138-
var mongoClient = new MongoClient("mongodb://<username>:<password>@<hostname>:<port>?tls=true&tlsInsecure=true");
138+
var mongoClient = new MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>?tls=true&tlsInsecure=true");
139139

140140
.. warning::
141141

@@ -183,7 +183,7 @@ revoked before it connects. You can enable revocation checking using either
183183

184184
.. code-block:: csharp
185185

186-
var mongoClient = new MongoClient("mongodb://<username>:<password>@<hostname>:<port>?tls=true&tlsDisableCertificateRevocationCheck=false");
186+
var mongoClient = new MongoClient("mongodb://<db_username>:<db_password>@<hostname>:<port>?tls=true&tlsDisableCertificateRevocationCheck=false");
187187

188188
.. note::
189189

source/fundamentals/enterprise-authentication.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ qualified domain name of the host:
107107

108108
.. code-block:: csharp
109109

110-
var mongoClient = new MongoClient("mongodb://<username>:<password>@<hostname>/?authMechanism=GSSAPI&authMechanismProperties=CANONICALIZE_HOSTNAME:true");
110+
var mongoClient = new MongoClient("mongodb://<db_username>:<db_password>@<hostname>/?authMechanism=GSSAPI&authMechanismProperties=CANONICALIZE_HOSTNAME:true");
111111

112112
.. tab:: MongoCredential
113113
:tabid: mongo-credential
114114

115115
.. code-block:: csharp
116116
:emphasize-lines: 1, 2
117117

118-
var credential = MongoCredential.CreateGssapiCredential("<username>", "<password>");
118+
var credential = MongoCredential.CreateGssapiCredential("<db_username>", "<db_passwordpassword>");
119119
credential = credential.WithMechanismProperty("CANONICALIZE_HOST_NAME", "true");
120120

121121
var settings = MongoClientSettings.FromConnectionString("<connection string>");
@@ -135,15 +135,15 @@ from the service's realm:
135135

136136
.. code-block:: csharp
137137

138-
var mongoClient = new MongoClient("mongodb://<username>:<password>@<hostname>/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_REALM:<user's realm>");
138+
var mongoClient = new MongoClient("mongodb://<db_username>:<db_password>@<hostname>/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_REALM:<user's realm>");
139139

140140
.. tab:: MongoCredential
141141
:tabid: mongo-credential
142142

143143
.. code-block:: csharp
144144
:emphasize-lines: 1, 2
145145

146-
var credential = MongoCredential.CreateGssapiCredential("<username>", "<password>");
146+
var credential = MongoCredential.CreateGssapiCredential("<db_username>", "<db_password>");
147147
credential = credential.WithMechanismProperty("SERVICE_REALM", "<user's realm>");
148148

149149
var settings = MongoClientSettings.FromConnectionString("<connection string>");
@@ -163,15 +163,15 @@ default ``mongodb``:
163163

164164
.. code-block:: csharp
165165

166-
var mongoClient = new MongoClient("mongodb://<username>:<password>@<hostname>/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:<service name>");
166+
var mongoClient = new MongoClient("mongodb://<db_username>:<db_password>@<hostname>/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:<service name>");
167167

168168
.. tab:: MongoCredential
169169
:tabid: mongo-credential
170170

171171
.. code-block:: csharp
172172
:emphasize-lines: 1, 2
173173

174-
var credential = MongoCredential.CreateGssapiCredential("<username>", "<password>");
174+
var credential = MongoCredential.CreateGssapiCredential("<db_username>", "<db_password>");
175175
credential = credential.WithMechanismProperty("SERVICE_NAME", "<service name>");
176176

177177
var settings = MongoClientSettings.FromConnectionString("<connection string>");
@@ -191,15 +191,15 @@ properties:
191191

192192
.. code-block:: csharp
193193

194-
var mongoClient = new MongoClient("mongodb://<username>:<password>@<hostname>/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:<service name>,SERVICE_REALM:<user's realm>");
194+
var mongoClient = new MongoClient("mongodb://<db_username>:<db_password>@<hostname>/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:<service name>,SERVICE_REALM:<user's realm>");
195195

196196
.. tab:: MongoCredential
197197
:tabid: mongo-credential
198198

199199
.. code-block:: csharp
200200
:emphasize-lines: 2, 3
201201

202-
var credential = MongoCredential.CreateGssapiCredential("<username>", "<password>");
202+
var credential = MongoCredential.CreateGssapiCredential("<db_username>", "<db_password>");
203203
credential = credential.WithMechanismProperty("SERVICE_REALM", "<user's realm>")
204204
.WithMechanismProperty("SERVICE_NAME", "<service name>");
205205

source/quick-start.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ a connection string similar to the following in your copy buffer:
3535

3636
.. code-block:: bash
3737

38-
"mongodb+srv://<username>:<password>@cluster0.abc.mongodb.net/?retryWrites=true&w=majority"
38+
"mongodb+srv://<db_username>:<db_password>@cluster0.abc.mongodb.net/?retryWrites=true&w=majority"
3939

4040
Set Your Connection String
4141
~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -60,8 +60,8 @@ code.
6060

6161
.. important::
6262

63-
Make sure to replace the ``<username>`` and ``<password>`` sections of the connection
64-
string with the username and password of your Atlas user.
63+
Make sure to replace the ``<db_username>`` and ``<db_password>`` sections of the connection
64+
string with the username and password of your Atlas database user.
6565

6666
For more information about connection strings, see :manual:`Connection Strings </reference/connection-string/#connection-strings>`.
6767

0 commit comments

Comments
 (0)