Skip to content

Commit 14670dc

Browse files
DOCSP-48713 Update non-MongoDB credentials (#676) (#677)
* DOCSP-48713 Update non-MongoDB credentials * edits to gssapi (cherry picked from commit ba0d907) Co-authored-by: lindseymoore <[email protected]>
1 parent 2c9ffcb commit 14670dc

7 files changed

+11
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.. code-block:: java
22
3-
MongoCredential credential = MongoCredential.createGSSAPICredential(<db_username>);
3+
MongoCredential credential = MongoCredential.createGSSAPICredential(<principal_username>);
44
credential = credential.withMechanismProperty(MongoCredential.SERVICE_NAME_KEY, "myService");
55

source/includes/fundamentals/code-snippets/auth-credentials-gssapi-subject-key.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
loginContext.login();
55
Subject subject = loginContext.getSubject();
66
7-
MongoCredential credential = MongoCredential.createGSSAPICredential(<db_username>);
7+
MongoCredential credential = MongoCredential.createGSSAPICredential(<principal_username>);
88
credential = credential.withMechanismProperty(MongoCredential.JAVA_SUBJECT_KEY, subject);
99

source/includes/fundamentals/code-snippets/auth-credentials-gssapi-ticket-cache.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* all MongoClient instances sharing this instance of KerberosSubjectProvider
44
will share a Kerberos ticket cache */
55
String myLoginContext = "myContext";
6-
MongoCredential credential = MongoCredential.createGSSAPICredential(<db_username>);
6+
MongoCredential credential = MongoCredential.createGSSAPICredential(<principal_username>);
77
/* login context defaults to "com.sun.security.jgss.krb5.initiate"
88
if unspecified in KerberosSubjectProvider */
99
credential = credential.withMechanismProperty(MongoCredential.JAVA_SUBJECT_PROVIDER_KEY,

source/includes/fundamentals/code-snippets/auth-credentials-gssapi.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. code-block:: java
22
3-
MongoCredential credential = MongoCredential.createGSSAPICredential(<db_username>);
3+
MongoCredential credential = MongoCredential.createGSSAPICredential(<principal_username>);
44
55
MongoClient mongoClient = MongoClients.create(
66
MongoClientSettings.builder()

source/includes/fundamentals/code-snippets/auth-credentials-ldap.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. code-block:: java
22
3-
MongoCredential credential = MongoCredential.createPlainCredential(<db_username>, "$external", <db_password>);
3+
MongoCredential credential = MongoCredential.createPlainCredential(<username>, "$external", <db_password>);
44
55
MongoClient mongoClient = MongoClients.create(
66
MongoClientSettings.builder()

source/security/auth/kerberos.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Code Placeholders
2929

3030
The code examples on this page use the following placeholders:
3131

32-
- ``<db_username>``: Your :wikipedia:`URL-encoded <Percent-encoding>` principal name. For
32+
- ``<principal_username>``: Your :wikipedia:`URL-encoded <Percent-encoding>` principal name. For
3333
example: ``"username%40REALM.ME"``
3434
- ``<hostname>``: The network address of your MongoDB deployment.
3535
- ``<port>``: The port number of your MongoDB deployment. If you omit this parameter,
@@ -64,7 +64,7 @@ mechanism:
6464

6565
.. code-block:: java
6666

67-
MongoClient mongoClient = MongoClients.create("<db_username>@<hostname>:<port>/?authSource=$external&authMechanism=GSSAPI");
67+
MongoClient mongoClient = MongoClients.create("<principal_username>@<hostname>:<port>/?authSource=$external&authMechanism=GSSAPI");
6868

6969
.. tab::
7070
:tabid: MongoCredential
@@ -125,7 +125,7 @@ You might need to specify one or more of the following
125125

126126
.. code-block:: java
127127

128-
MongoClient mongoClient = MongoClients.create("<db_username>@<hostname>:<port>/?authSource=$external&authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:myService");
128+
MongoClient mongoClient = MongoClients.create("<principal_username>@<hostname>:<port>/?authSource=$external&authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:myService");
129129

130130
.. tab::
131131
:tabid: MongoCredential

source/security/auth/ldap.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ Code Placeholders
3434

3535
The code examples on this page use the following placeholders:
3636

37-
- ``<db_username>``: Your LDAP username.
38-
- ``<db_password>``: Your LDAP password.
37+
- ``<username>``: Your LDAP username.
38+
- ``<password>``: Your LDAP password.
3939
- ``<hostname>``: The network address of your MongoDB deployment.
4040
- ``<port>``: The port number of your MongoDB deployment. If you omit this parameter,
4141
the driver uses the default port number (``27017``). You don't need to specify a port
@@ -70,7 +70,7 @@ mechanism:
7070

7171
.. code-block:: java
7272

73-
MongoClient mongoClient = MongoClients.create("<db_username>:<db_password>@<hostname>:<port>/?authSource=$external&authMechanism=PLAIN");
73+
MongoClient mongoClient = MongoClients.create("<username>:<password>@<hostname>:<port>/?authSource=$external&authMechanism=PLAIN");
7474

7575
.. tab::
7676
:tabid: MongoCredential

0 commit comments

Comments
 (0)