Skip to content

Commit a5eb728

Browse files
committed
authen remodel
1 parent 7c55fc8 commit a5eb728

File tree

1 file changed

+20
-33
lines changed

1 file changed

+20
-33
lines changed

source/security/authentication.txt

Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,10 @@ In this guide, you can learn how to authenticate with MongoDB using each
2525
Authentication mechanisms are processes by which the driver and server
2626
confirm identity and establish trust to ensure security.
2727

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-
3428
To select a specific authentication mechanism, you can specify the
3529
mechanism, your credentials, and other necessary information
3630
in the options of your connection string or in a ``Credential`` struct.
3731

38-
In this guide, the examples demonstrate how to configure
39-
authentication in a ``Credential`` struct.
40-
4132
To learn more about the connection string options for authentication,
4233
see the :manual:`Authentication Options
4334
</reference/connection-string/#authentication-options>` section
@@ -49,25 +40,21 @@ To authenticate using ``Kerberos`` or ``LDAP``, see the
4940
For more information on establishing a connection to your MongoDB cluster,
5041
see :ref:`Connect to MongoDB <kotlin-sync-connect>`.
5142

52-
.. _kotlin-sync-auth-scram-mechanisms:
43+
.. _kotlin-sybc-auth-default:
5344

54-
SCRAM-Based Mechanisms
55-
----------------------
45+
Default
46+
-------
5647

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:
6050

61-
MongoDB supports the following SCRAM-based authentication mechanisms:
51+
#. ``SCRAM-SHA-256``
52+
#. ``SCRAM-SHA-1``
6253

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.
6956

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,
7158
using the following placeholders:
7259

7360
* ``db_username`` - your MongoDB database username
@@ -82,8 +69,6 @@ Select the :guilabel:`Connection String` or the :guilabel:`MongoCredential`
8269
tab below for instructions and sample code for specifying this authentication
8370
mechanism:
8471

85-
.. _mongo-client-setting-with-mongo-credential-example:
86-
8772
.. tabs::
8873

8974
.. tab::
@@ -123,14 +108,15 @@ the Server manual.
123108
.. _kotlin-sync-auth-scramsha256:
124109

125110
SCRAM-SHA-256
126-
~~~~~~~~~~~~~
111+
-------------
127112

128113
.. note::
129114

130115
``SCRAM-SHA-256`` is the default authentication method for MongoDB starting
131116
in MongoDB 4.0.
132117

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
134120
(SCRAM) that uses your username and password, encrypted with the ``SHA-256``
135121
algorithm, to authenticate your user.
136122

@@ -186,13 +172,14 @@ mechanism:
186172
.. _kotlin-sync-auth-scramsha1:
187173

188174
SCRAM-SHA-1
189-
~~~~~~~~~~~
175+
-----------
190176

191177
.. note::
192178
``SCRAM-SHA-1`` is the default authentication method for MongoDB versions
193179
3.0, 3.2, 3.4, and 3.6.
194180

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
196183
username and password, encrypted with the ``SHA-1`` algorithm, to authenticate
197184
your user.
198185

@@ -247,8 +234,8 @@ mechanism:
247234

248235
.. _kotlin-sync-auth-aws:
249236

250-
MONGODB-AWS Mechanism
251-
---------------------
237+
MONGODB-AWS
238+
-----------
252239

253240
.. note::
254241

@@ -495,8 +482,8 @@ method:
495482

496483
.. _kotlin-sync-auth-x509:
497484

498-
MONGODB-X509 Mechanism
499-
----------------------
485+
MONGODB-X509
486+
------------
500487

501488
The ``X.509`` authentication mechanism uses
502489
:wikipedia:`TLS <Transport_Layer_Security>` with X.509 certificates to

0 commit comments

Comments
 (0)