Skip to content

Commit 7194750

Browse files
committed
edits, build errors
1 parent 509ac62 commit 7194750

File tree

10 files changed

+71
-61
lines changed

10 files changed

+71
-61
lines changed

snooty.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ toc_landing_pages = [
1212
"/crud",
1313
"/crud/builders",
1414
"/data-formats",
15-
"/api-documentation"
15+
"/api-documentation",
16+
"/security/auth"
1617
]
1718

1819
sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/"

source/connection.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ sections:
3838
- :atlas:`Connect to MongoDB Atlas from AWS Lambda </manage-connections-aws-lambda/>`
3939

4040
For information about authenticating with a MongoDB instance,
41-
see :ref:`<authentication-mechanisms>` and :ref:`<enterprise-authentication-mechanisms>`.
41+
see the :ref:`<java-authentication-mechanisms>` section.

source/faq.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,8 @@ check the following items in your code:
185185

186186
- The credentials for the authentication mechanism that you specified are
187187
correct. To learn how to specify your credentials, see the
188-
:ref:`authentication-mechanisms` and :ref:`enterprise-authentication-mechanisms`
189-
guides.
190-
188+
:ref:`java-authentication-mechanisms` section.
189+
191190
- The name of the authentication database that you specified is correct. To
192191
learn how to set up the users and roles for your MongoDB deployment, see
193192
`Manage Users and Roles <https://www.mongodb.com/docs/manual/tutorial/manage-users-and-roles/>`__

source/security/auth/aws-iam.txt

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ provide your AWS IAM credentials.
5656

5757
.. _java-mongodb-aws-sdk:
5858

59-
AWS SDK for Java
60-
~~~~~~~~~~~~~~~~
59+
Use AWS SDK for Java
60+
~~~~~~~~~~~~~~~~~~~~
6161

6262
.. important::
6363

@@ -72,11 +72,11 @@ offers the following features:
7272
- Credential provider management for use with the `Elastic Kubernetes Service <https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html>`__.
7373

7474
To use the AWS SDK for Java for ``MONGODB-AWS`` authentication, you must
75-
perform the following:
75+
perform the following actions:
7676

7777
1. Specify the authentication mechanism
7878
#. Add the SDK as a dependency to your project
79-
#. Supply your credentials using one of the methods in the credential
79+
#. Supply your credentials by using one of the methods in the credential
8080
provider chain
8181

8282
To specify the authentication mechanism by using a ``MongoCredential``,
@@ -89,7 +89,7 @@ in the following example:
8989
:dedent:
9090
:start-after: start mechOnlyMongoCredential
9191
:end-before: end mechOnlyMongoCredential
92-
:emphasize-lines: 1,7
92+
:emphasize-lines: 1,8
9393

9494
To specify the authentication mechanism in the connection string, add
9595
it as a parameter as shown in the following example:
@@ -110,10 +110,10 @@ AWS documentation for the version you need:
110110

111111
.. note::
112112

113-
For the AWS SDK for Java v2, the Java driver currently tests using the
113+
For the AWS SDK for Java v2, the Java driver tests using the
114114
``software.amazon.awssdk:auth:2.18.9`` dependency.
115115

116-
For the AWS SDK for Java v1, the Java driver currently tests using the
116+
For the AWS SDK for Java v1, the Java driver tests using the
117117
``com.amazonaws:aws-java-sdk-core:1.12.337`` dependency.
118118

119119
To supply your credentials, see the following AWS documentation for the
@@ -142,21 +142,21 @@ version you need:
142142

143143
.. _java-mongodb-aws-env-variables:
144144

145-
Specify Your Credentials in the Environment
146-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
145+
Use Environment Variables
146+
~~~~~~~~~~~~~~~~~~~~~~~~~
147147

148148
You can provide your AWS IAM credentials by instructing the driver to
149149
use the ``MONGODB-AWS`` authentication mechanism and by setting the
150150
appropriate environment variables.
151151

152152
To use the environment variables to supply your credentials, you must perform
153-
the following:
153+
the following actions:
154154

155155
1. Specify the authentication mechanism
156156
#. Add the appropriate environment variables
157157

158158
You can specify the authentication mechanism by using a ``MongoCredential``
159-
or on the connection string.
159+
or in the connection string.
160160

161161
To specify the authentication mechanism by using a ``MongoCredential``,
162162
use the ``MongoCredential.createAwsCredential()`` factory method and add the
@@ -168,7 +168,7 @@ example:
168168
:dedent:
169169
:start-after: start mechOnlyMongoCredential
170170
:end-before: end mechOnlyMongoCredential
171-
:emphasize-lines: 1,7
171+
:emphasize-lines: 1,8
172172

173173
To specify the authentication mechanism in the connection string, add it as a
174174
parameter as shown in the following example:
@@ -179,8 +179,8 @@ parameter as shown in the following example:
179179
:start-after: start mechOnlyConnectionString
180180
:end-before: end mechOnlyConnectionString
181181

182-
The next examples show how to provide your credentials by setting environment
183-
variables for the following types of authentication:
182+
You can also set environment variables to enable the following types of
183+
authentication:
184184

185185
- Programmatic access keys
186186
- Web identity provider
@@ -230,21 +230,22 @@ of from environment variables.
230230

231231
.. _java-mongodb-aws-mongoclient-configuration:
232232

233-
Specify Your Credentials in a MongoCredential
234-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
233+
Use a MongoCredential Instance
234+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
235235

236236
You can supply your AWS IAM credentials to a ``MongoClient`` by using a
237237
``MongoCredential`` instance. To construct the ``MongoCredential`` instance
238-
for ``MONGODB-AWS`` authentication, use the `createAwsCredential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createAwsCredential(java.lang.String,char%5B%5D)>`__
238+
for ``MONGODB-AWS`` authentication, use the ``createAwsCredential()``
239239
factory method.
240240

241241
You can supply only programmatic access keys to the
242242
``MongoCredential.createAwsCredential()`` method. If you must supply ECS
243-
or EC2 container credentials, use the instructions in
244-
:ref:`<java-mongodb-aws-env-variables>` or :ref:`<java-mongodb-aws-sdk>`.
243+
or EC2 container credentials, use the instructions in the
244+
:ref:`<java-mongodb-aws-env-variables>` or :ref:`<java-mongodb-aws-sdk>`
245+
sections.
245246

246247
To use the ``MongoCredential`` for ``MONGODB-AWS`` authentication, you
247-
must perform the following:
248+
must perform the following actions:
248249

249250
1. Specify the authentication mechanism
250251
#. Supply the credentials
@@ -259,7 +260,7 @@ in the following example:
259260
:dedent:
260261
:start-after: start mongoCredential
261262
:end-before: end mongoCredential
262-
:emphasize-lines: 1
263+
:emphasize-lines: 1,8
263264

264265
If you must specify an AWS session token, pass it to the
265266
`withMechanismProperty() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#withMechanismProperty(java.lang.String,T)>`__
@@ -270,7 +271,7 @@ method as shown in the following example:
270271
:dedent:
271272
:start-after: start mongoCredentialSessionTokenCredential
272273
:end-before: end mongoCredentialSessionTokenCredential
273-
:emphasize-lines: 1,7
274+
:emphasize-lines: 1,8
274275

275276
To refresh your credentials, you can declare a ``Supplier`` lambda expression
276277
that returns new credentials as shown in the following example:
@@ -280,11 +281,11 @@ that returns new credentials as shown in the following example:
280281
:dedent:
281282
:start-after: start refreshCredentials
282283
:end-before: end refreshCredentials
283-
:emphasize-lines: 4-5,8-9
284+
:emphasize-lines: 1-5,9
284285

285286
.. note::
286287

287-
If you must provide AWS IAM credentials in a connection string, refer to
288+
If you must provide AWS IAM credentials in a connection string, see
288289
v4.7 or earlier of the {+driver-short+} documentation.
289290

290291
API Documentation

source/security/auth/kerberos.txt

Lines changed: 4 additions & 5 deletions
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-
- ``<username>``: Your :wikipedia:`URL-encoded <Percent-encoding>` principal name. For
32+
- ``<db_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,
@@ -77,8 +77,7 @@ mechanism:
7777
.. include:: /includes/fundamentals/code-snippets/auth-credentials-gssapi.rst
7878

7979

80-
In order to acquire a
81-
`Kerberos ticket <https://docs.oracle.com/en/java/javase/11/docs/api/java.security.jgss/javax/security/auth/kerberos/KerberosTicket.html>`__,
80+
To acquire a `Kerberos ticket <https://docs.oracle.com/en/java/javase/11/docs/api/java.security.jgss/javax/security/auth/kerberos/KerberosTicket.html>`__,
8281
the GSSAPI Java libraries require you to specify the realm and Key Distribution
8382
Center (KDC) system properties. See the sample settings in the following example:
8483

@@ -90,7 +89,7 @@ Center (KDC) system properties. See the sample settings in the following example
9089
Additional Properties
9190
~~~~~~~~~~~~~~~~~~~~~
9291

93-
You might need to specify one or more of the following additional
92+
You might need to specify one or more of the followingx
9493
``MongoCredential`` mechanism properties depending on your Kerberos setup:
9594

9695
- ``SERVICE_NAME``
@@ -210,4 +209,4 @@ page, see the following API documentation:
210209
- `MongoClient <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html>`__
211210
- `MongoCredential <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html>`__
212211
- `MongoCredential.createGSSAPICredential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createGSSAPICredential(java.lang.String)>`__
213-
- `MongoCredential.withMechanismProperty() <{+api+}/apidocs/mongodb-driver-core/com/mongodbMongoCredential.html#withMechanismProperty(java.lang.String,T)>`__
212+
- `MongoCredential.withMechanismProperty() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#withMechanismProperty(java.lang.String,T)>`__

source/security/auth/ldap.txt

Lines changed: 4 additions & 4 deletions
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-
- ``<username>``: Your LDAP username.
38-
- ``<password>``: Your LDAP password.
37+
- ``<db_username>``: Your LDAP username.
38+
- ``<db_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
@@ -55,7 +55,7 @@ mechanism:
5555
.. tab::
5656
:tabid: Connection String
5757

58-
To specify the LDAP (PLAIN) authentication mechanism using a connection
58+
To specify the LDAP (PLAIN) authentication mechanism by using a connection
5959
string, perform the following actions:
6060

6161
- Assign the ``authMechanism`` URL parameter to the value ``PLAIN``
@@ -75,7 +75,7 @@ mechanism:
7575
.. tab::
7676
:tabid: MongoCredential
7777

78-
To specify the LDAP (PLAIN) authentication mechanism using the
78+
To specify the LDAP (PLAIN) authentication mechanism by using the
7979
``MongoCredential`` class, use the ``createPlainCredential()``
8080
method. The code to instantiate a ``MongoClient`` resembles the following:
8181

source/security/auth/oidc.txt

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,23 @@ Enterprise Advanced, and only when authenticating to MongoDB v7.0 or later.
3434
in the Atlas documentation.
3535

3636
For more information about using OIDC authentication with MongoDB, see
37-
:manual:`OpenID Connect Authentication </core/security-oidc/>` and
38-
:manual:`MongoDB Server Parameters </reference/parameters/#mongodb-parameter-param.oidcIdentityProviders>`
37+
:manual:`Authentication and Authorization with OIDC/OAuth 2.0 </core/security-oidc/>` and
38+
:manual:`oidcIdentityProviders </reference/parameters/#mongodb-parameter-param.oidcIdentityProviders>`
3939
in the {+mdb-server+} manual.
4040

41+
Code Placeholders
42+
~~~~~~~~~~~~~~~~~
43+
44+
The code examples on this page use the following placeholders:
45+
46+
- ``<db_username>``: The MongoDB username of the user to authenticate.
47+
- ``<hostname>``: The network address of your MongoDB deployment.
48+
- ``<port>``: The port number of your MongoDB deployment. If you omit this parameter,
49+
the driver uses the default port number (``27017``). You don't need a port number
50+
when connecting to a MongoDB Atlas cluster.
51+
52+
To use the code examples, replace these placeholders with your own values.
53+
4154
Specify OIDC Authentication
4255
---------------------------
4356

@@ -85,9 +98,7 @@ see the corresponding syntax:
8598
.. tab:: MongoCredential
8699
:tabid: mongodb-azure-mongo-credential
87100

88-
Replace the ``<db_username>`` placeholder with the client ID or application ID of the
89-
Azure managed identity or enterprise application. Replace the ``<audience>``
90-
placeholder with the value of the
101+
Replace the ``<audience>`` placeholder with the value of the
91102
``audience`` server parameter configured on your MongoDB deployment.
92103

93104
.. code-block:: java
@@ -208,4 +219,4 @@ page, see the following API documentation:
208219
- `MongoClient <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html>`__
209220
- `MongoCredential <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html>`__
210221
- `MongoCredential.createOidcCredential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createOidcCredential(java.lang.String)>`__
211-
- `MongoCredential.withMechanismProperty() <{+api+}/apidocs/mongodb-driver-core/com/mongodbMongoCredential.html#withMechanismProperty(java.lang.String,T)>`__
222+
- `MongoCredential.withMechanismProperty() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#withMechanismProperty(java.lang.String,T)>`__

source/security/auth/scram.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ tab below for instructions and sample code for the corresponding syntax:
6969
.. tab::
7070
:tabid: Connection String
7171

72-
To specify the default authentication mechanism using a connection
72+
To specify the default authentication mechanism by using a connection
7373
string, omit the mechanism. The code to instantiate a ``MongoClient``
7474
resembles the following:
7575

@@ -80,7 +80,7 @@ tab below for instructions and sample code for the corresponding syntax:
8080
.. tab::
8181
:tabid: MongoCredential
8282

83-
To specify the default authentication mechanism using the
83+
To specify the default authentication mechanism by using the
8484
``MongoCredential`` class, use the ``createCredential()`` method. The
8585
code to instantiate a ``MongoClient`` resembles the following:
8686

@@ -109,7 +109,7 @@ mechanism:
109109
.. tab::
110110
:tabid: Connection String
111111

112-
To specify the ``SCRAM-SHA-256`` authentication mechanism using a
112+
To specify the ``SCRAM-SHA-256`` authentication mechanism by using a
113113
connection string, assign the ``authMechanism`` parameter the value
114114
``SCRAM-SHA-256`` in your connection string. The code to instantiate
115115
a ``MongoClient`` resembles the following:
@@ -121,7 +121,7 @@ mechanism:
121121
.. tab::
122122
:tabid: MongoCredential
123123

124-
To specify the default authentication mechanism using the
124+
To specify the ``SCRAM-SHA-256`` authentication mechanism by using the
125125
``MongoCredential`` class, use the ``createScramSha256Credential()``
126126
method. The code to instantiate a ``MongoClient`` resembles
127127
the following:
@@ -136,7 +136,7 @@ username and password, encrypted with the ``SHA-1`` algorithm, to authenticate
136136
your user.
137137

138138
``SCRAM-SHA-1`` is the default authentication method for MongoDB versions
139-
3.0, 3.2, 3.4, and 3.6, but this code example shows how to explicitly use this
139+
earlier than 4.0, but this code example shows how to explicitly use this
140140
mechanism. Select the :guilabel:`Connection String` or the :guilabel:`MongoCredential`
141141
tab for instructions and sample code for specifying this authentication
142142
mechanism:
@@ -146,7 +146,7 @@ mechanism:
146146
.. tab::
147147
:tabid: Connection String
148148

149-
To specify the ``SCRAM-SHA-1`` authentication mechanism using a
149+
To specify the ``SCRAM-SHA-1`` authentication mechanism by using a
150150
connection string, assign the ``authMechanism`` parameter the value
151151
``SCRAM-SHA-1`` in your connection string. The code to instantiate
152152
a ``MongoClient`` resembles the following:
@@ -158,7 +158,7 @@ mechanism:
158158
.. tab::
159159
:tabid: MongoCredential
160160

161-
To specify the default authentication mechanism using the
161+
To specify the ``SCRAM-SHA-1`` authentication mechanism by using the
162162
``MongoCredential`` class, use the ``createScramSha1Credential()``
163163
method. The code to instantiate a ``MongoClient`` resembles the following:
164164

source/security/auth/x509.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ Enterprise Advanced, and MongoDB Community Edition.
3131
see :ref:`TLS/SSL <tls-ssl>`.
3232

3333
For more information about X.509 certificates, see
34-
:ref:`X.509 <x509-client-authentication>` in the {+mdb-server+} manual.
34+
:manual:`Use x.509 Certificates to Authenticate Clients on Self-Managed Deployments
35+
</tutorial/configure-x509-client-authentication/>` in the {+mdb-server+} manual.
3536

3637
Code Placeholders
3738
~~~~~~~~~~~~~~~~~
@@ -60,11 +61,10 @@ mechanism:
6061
.. tab::
6162
:tabid: Connection String
6263

63-
To specify the ``X.509`` authentication mechanism using a connection
64-
string, assign the ``authMechanism`` parameter the value ``MONGODB-X509``
65-
and enable TLS by assigning the ``tls``
66-
parameter a ``true`` value. The code to instantiate a ``MongoClient``
67-
resembles the following:
64+
To specify the ``X.509`` authentication mechanism by using a connection
65+
string, assign the ``authMechanism`` parameter to ``MONGODB-X509``
66+
and enable TLS by assigning the ``tls`` parameter to ``true``. The code
67+
to instantiate a ``MongoClient`` resembles the following:
6868

6969
.. code-block:: java
7070

@@ -73,7 +73,7 @@ mechanism:
7373
.. tab::
7474
:tabid: MongoCredential
7575

76-
To specify the ``X.509`` authentication mechanism using the
76+
To specify the ``X.509`` authentication mechanism by using the
7777
``MongoCredential`` class, use the ``createMongoX509Credential()``
7878
method. Also, enable TLS by calling the
7979
`applyToSslSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToSslSettings(com.mongodb.Block)>`__

0 commit comments

Comments
 (0)