@@ -48,29 +48,31 @@ Mechanisms
48
48
----------
49
49
50
50
.. _default-auth-mechanism:
51
+ .. _scram-sha-256-auth-mechanism:
51
52
52
- Default
53
- ~~~~~~~
53
+ ``SCRAM-SHA-256``
54
+ ~~~~~~~~~~~~~~~~~
54
55
55
- The default authentication mechanism is ``SCRAM-SHA-256``.
56
+ ``SCRAM-SHA-256`` is a salted challenge-response authentication mechanism
57
+ (SCRAM) that uses your username and password, encrypted with the ``SHA-256``
58
+ algorithm, to authenticate your user. This is the default authentication
59
+ mechanism.
56
60
57
61
The following code snippets show how to specify the authentication mechanism,
58
62
using the following placeholders:
59
63
60
- * ``db_username`` - your MongoDB database username
61
- * ``db_password`` - your MongoDB database user's password
62
- * ``hostname`` - network address of your MongoDB server, accessible by your client
63
- * ``port`` - port number of your MongoDB server
64
+ * ``db_username`` - your MongoDB database username.
65
+ * ``db_password`` - your MongoDB database user's password.
66
+ * ``hostname`` - network address of your MongoDB server, accessible by your client.
67
+ * ``port`` - port number of your MongoDB server.
64
68
* ``authenticationDb`` - MongoDB database that contains your user's
65
69
authentication data. If you omit this parameter, the driver uses the
66
70
default value ``admin``.
67
71
68
72
Select the :guilabel:`Connection String` or the :guilabel:`MongoCredential`
69
- tab below for instructions and sample code for specifying this authentication
73
+ tab below for instructions and sample code to specify this default authentication
70
74
mechanism:
71
75
72
- .. _mongo-client-setting-with-mongo-credential-example:
73
-
74
76
.. tabs::
75
77
76
78
.. tab::
@@ -93,33 +95,10 @@ mechanism:
93
95
.. literalinclude:: /examples/generated/AuthTest.snippet.default-mongo-cred.kt
94
96
:language: kotlin
95
97
96
- For more information on the challenge-response (CR) and salted
97
- challenge-response authentication mechanisms (SCRAM) that MongoDB supports,
98
- see the :manual:`SCRAM </core/security-scram/>` section of the Server manual.
99
-
100
- .. _scram-sha-256-auth-mechanism:
101
-
102
- ``SCRAM-SHA-256``
103
- ~~~~~~~~~~~~~~~~~
104
-
105
- ``SCRAM-SHA-256`` is a salted challenge-response authentication mechanism
106
- (SCRAM) that uses your username and password, encrypted with the ``SHA-256``
107
- algorithm, to authenticate your user.
108
-
109
- The following code snippets show how to specify the authentication mechanism,
110
- using the following placeholders:
111
-
112
- * ``db_username`` - your MongoDB database username.
113
- * ``db_password`` - your MongoDB database user's password.
114
- * ``hostname`` - network address of your MongoDB server, accessible by your client.
115
- * ``port`` - port number of your MongoDB server.
116
- * ``authenticationDb`` - MongoDB database that contains your user's
117
- authentication data. If you omit this parameter, the driver uses the
118
- default value ``admin``.
119
-
120
- Select the :guilabel:`Connection String` or the :guilabel:`MongoCredential`
121
- tab below for instructions and sample code for specifying this authentication
122
- mechanism:
98
+ You can also explicitly specify the ``SCRAM-SHA-256`` authentication mechanism,
99
+ as shown in the following code snippets. Select the :guilabel:`Connection String`
100
+ or the :guilabel:`MongoCredential` tab below for instructions and sample code for
101
+ specifying this authentication mechanism:
123
102
124
103
.. tabs::
125
104
0 commit comments