You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To supply your credentials, see the following AWS documentation for the
@@ -142,21 +142,21 @@ version you need:
142
142
143
143
.. _java-mongodb-aws-env-variables:
144
144
145
-
Specify Your Credentials in the Environment
146
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
145
+
Use Environment Variables
146
+
~~~~~~~~~~~~~~~~~~~~~~~~~
147
147
148
148
You can provide your AWS IAM credentials by instructing the driver to
149
149
use the ``MONGODB-AWS`` authentication mechanism and by setting the
150
150
appropriate environment variables.
151
151
152
152
To use the environment variables to supply your credentials, you must perform
153
-
the following:
153
+
the following actions:
154
154
155
155
1. Specify the authentication mechanism
156
156
#. Add the appropriate environment variables
157
157
158
158
You can specify the authentication mechanism by using a ``MongoCredential``
159
-
or on the connection string.
159
+
or in the connection string.
160
160
161
161
To specify the authentication mechanism by using a ``MongoCredential``,
162
162
use the ``MongoCredential.createAwsCredential()`` factory method and add the
@@ -168,7 +168,7 @@ example:
168
168
:dedent:
169
169
:start-after: start mechOnlyMongoCredential
170
170
:end-before: end mechOnlyMongoCredential
171
-
:emphasize-lines: 1,7
171
+
:emphasize-lines: 1,8
172
172
173
173
To specify the authentication mechanism in the connection string, add it as a
174
174
parameter as shown in the following example:
@@ -179,8 +179,8 @@ parameter as shown in the following example:
179
179
:start-after: start mechOnlyConnectionString
180
180
:end-before: end mechOnlyConnectionString
181
181
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:
184
184
185
185
- Programmatic access keys
186
186
- Web identity provider
@@ -230,21 +230,22 @@ of from environment variables.
230
230
231
231
.. _java-mongodb-aws-mongoclient-configuration:
232
232
233
-
Specify Your Credentials in a MongoCredential
234
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
233
+
Use a MongoCredential Instance
234
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
235
235
236
236
You can supply your AWS IAM credentials to a ``MongoClient`` by using a
237
237
``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()``
239
239
factory method.
240
240
241
241
You can supply only programmatic access keys to the
242
242
``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.
245
246
246
247
To use the ``MongoCredential`` for ``MONGODB-AWS`` authentication, you
247
-
must perform the following:
248
+
must perform the following actions:
248
249
249
250
1. Specify the authentication mechanism
250
251
#. Supply the credentials
@@ -259,7 +260,7 @@ in the following example:
259
260
:dedent:
260
261
:start-after: start mongoCredential
261
262
:end-before: end mongoCredential
262
-
:emphasize-lines: 1
263
+
:emphasize-lines: 1,8
263
264
264
265
If you must specify an AWS session token, pass it to the
To acquire a `Kerberos ticket <https://docs.oracle.com/en/java/javase/11/docs/api/java.security.jgss/javax/security/auth/kerberos/KerberosTicket.html>`__,
82
81
the GSSAPI Java libraries require you to specify the realm and Key Distribution
83
82
Center (KDC) system properties. See the sample settings in the following example:
84
83
@@ -90,7 +89,7 @@ Center (KDC) system properties. See the sample settings in the following example
90
89
Additional Properties
91
90
~~~~~~~~~~~~~~~~~~~~~
92
91
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
94
93
``MongoCredential`` mechanism properties depending on your Kerberos setup:
95
94
96
95
- ``SERVICE_NAME``
@@ -210,4 +209,4 @@ page, see the following API documentation:
0 commit comments