@@ -25,19 +25,10 @@ In this guide, you can learn how to authenticate with MongoDB using each
25
25
Authentication mechanisms are processes by which the driver and server
26
26
confirm identity and establish trust to ensure security.
27
27
28
- This guide describes the following authentication mechanisms:
29
-
30
- - :ref:`SCRAM-Based Mechanisms <kotlin-sync-auth-scram-mechanisms>`
31
- - :ref:`MONGODB-AWS Mechanism <kotlin-sync-auth-aws>`
32
- - :ref:`MONGODB-X509 Mechanism <kotlin-sync-auth-x509>`
33
-
34
28
To select a specific authentication mechanism, you can specify the
35
29
mechanism, your credentials, and other necessary information
36
30
in the options of your connection string or in a ``Credential`` struct.
37
31
38
- In this guide, the examples demonstrate how to configure
39
- authentication in a ``Credential`` struct.
40
-
41
32
To learn more about the connection string options for authentication,
42
33
see the :manual:`Authentication Options
43
34
</reference/connection-string/#authentication-options>` section
@@ -49,25 +40,21 @@ To authenticate using ``Kerberos`` or ``LDAP``, see the
49
40
For more information on establishing a connection to your MongoDB cluster,
50
41
see :ref:`Connect to MongoDB <kotlin-sync-connect>`.
51
42
52
- .. _kotlin-sync -auth-scram-mechanisms :
43
+ .. _kotlin-sybc -auth-default :
53
44
54
- SCRAM-Based Mechanisms
55
- ----------------------
45
+ Default
46
+ -------
56
47
57
- Salted challenge response authentication mechanism (SCRAM) refers to a
58
- group of authentication mechanisms that use a username and
59
- password to authenticate to a server.
48
+ The default authentication mechanism setting uses one of the following
49
+ authentication mechanisms depending on what your MongoDB server supports:
60
50
61
- MongoDB supports the following SCRAM-based authentication mechanisms:
51
+ #. ``SCRAM-SHA-256``
52
+ #. ``SCRAM-SHA-1``
62
53
63
- - :ref:`SCRAM-SHA-256 <kotlin-sync-auth-scramsha256>`: an authentication mechanism that
64
- uses your database username and password, encrypted with the ``SHA-256``
65
- algorithm
66
- - :ref:`SCRAM-SHA-1 <kotlin-sync-auth-scramsha1>`: an authentication mechanism that
67
- uses your database username and password, encrypted with the ``SHA-1``
68
- algorithm
54
+ Server versions 4.0 and later use ``SCRAM-SHA-256`` as the default
55
+ mechanism.
69
56
70
- The following code snippets show how to specify the authentication mechanism,
57
+ The following code snippets show how to use the default authentication mechanism,
71
58
using the following placeholders:
72
59
73
60
* ``db_username`` - your MongoDB database username
@@ -82,8 +69,6 @@ Select the :guilabel:`Connection String` or the :guilabel:`MongoCredential`
82
69
tab below for instructions and sample code for specifying this authentication
83
70
mechanism:
84
71
85
- .. _mongo-client-setting-with-mongo-credential-example:
86
-
87
72
.. tabs::
88
73
89
74
.. tab::
@@ -123,14 +108,15 @@ the Server manual.
123
108
.. _kotlin-sync-auth-scramsha256:
124
109
125
110
SCRAM-SHA-256
126
- ~~~~~~~~~~~~~
111
+ -------------
127
112
128
113
.. note::
129
114
130
115
``SCRAM-SHA-256`` is the default authentication method for MongoDB starting
131
116
in MongoDB 4.0.
132
117
133
- ``SCRAM-SHA-256`` is a salted challenge-response authentication mechanism
118
+ ``SCRAM-SHA-256``, as defined by `RFC 7677 <https://www.rfc-editor.org/rfc/rfc7677>`__,
119
+ is a salted challenge-response authentication mechanism
134
120
(SCRAM) that uses your username and password, encrypted with the ``SHA-256``
135
121
algorithm, to authenticate your user.
136
122
@@ -186,13 +172,14 @@ mechanism:
186
172
.. _kotlin-sync-auth-scramsha1:
187
173
188
174
SCRAM-SHA-1
189
- ~~~~~~~~~~~
175
+ -----------
190
176
191
177
.. note::
192
178
``SCRAM-SHA-1`` is the default authentication method for MongoDB versions
193
179
3.0, 3.2, 3.4, and 3.6.
194
180
195
- ``SCRAM-SHA-1`` is a salted challenge-response mechanism (SCRAM) that uses your
181
+ ``SCRAM-SHA-1``, as defined by `RFC 5802 <https://www.rfc-editor.org/rfc/rfc5802>`__,
182
+ is a salted challenge-response mechanism (SCRAM) that uses your
196
183
username and password, encrypted with the ``SHA-1`` algorithm, to authenticate
197
184
your user.
198
185
@@ -247,8 +234,8 @@ mechanism:
247
234
248
235
.. _kotlin-sync-auth-aws:
249
236
250
- MONGODB-AWS Mechanism
251
- ---------------------
237
+ MONGODB-AWS
238
+ -----------
252
239
253
240
.. note::
254
241
@@ -495,8 +482,8 @@ method:
495
482
496
483
.. _kotlin-sync-auth-x509:
497
484
498
- MONGODB-X509 Mechanism
499
- ----------------------
485
+ MONGODB-X509
486
+ ------------
500
487
501
488
The ``X.509`` authentication mechanism uses
502
489
:wikipedia:`TLS <Transport_Layer_Security>` with X.509 certificates to
0 commit comments