Skip to content

Commit f8e5fdf

Browse files
jmd-mongojeff-allen-mongo
authored andcommitted
DOCSP-15529 deprecates authentication as multiple simultaneous users
1 parent b69d2e3 commit f8e5fdf

File tree

7 files changed

+39
-12
lines changed

7 files changed

+39
-12
lines changed

source/includes/fact-authenticate.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,5 @@ To authenticate using the :binary:`~bin.mongo` shell, either:
1616
:method:`db.auth()` method against the :ref:`authentication database
1717
<mongo-shell-authentication-options>`.
1818

19-
.. important::
20-
21-
Authenticating multiple times as different users does **not** drop
22-
the credentials of previously-authenticated users. This may lead to
23-
a connection having more permissions than intended by the user, and
24-
causes operations within a
25-
:doc:`logical session </reference/server-sessions>` to raise an
26-
error.
27-
2819
For examples of authenticating using a MongoDB driver, see the
2920
`driver documentation <https://docs.mongodb.com/ecosystem/drivers/>`__.

source/reference/command/logout.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ logout
1212

1313
.. dbcommand:: logout
1414

15+
.. deprecated:: 5.0
16+
17+
Attempting to use the :dbcommand:`logout` command will write an
18+
error message to the log once per logout attempt.
19+
20+
This command will be removed in a future release.
21+
1522
The :dbcommand:`logout` command terminates the current
1623
authenticated session:
1724

@@ -33,3 +40,4 @@ logout
3340
.. code-block:: javascript
3441

3542
db.runCommand( { logout: 1 } )
43+

source/reference/command/nav-authentication.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Authentication Commands
3030

3131
* - :dbcommand:`logout`
3232

33-
- Terminates the current authenticated session.
33+
- *Deprecated*. Terminates the current authenticated session.
3434

3535

3636
.. toctree::

source/reference/method.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ Database
503503

504504
* - :method:`db.logout()`
505505

506-
- Ends an authenticated session.
506+
- *Deprecated*. Ends an authenticated session.
507507

508508
* - :method:`db.printCollectionStats()`
509509

source/reference/method/db.logout.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ db.logout()
1212

1313
.. method:: db.logout()
1414

15+
.. deprecated:: 5.0
16+
17+
Attempting to use the :method:`db.logout()` method will write an
18+
error message to the log once per logout attempt.
19+
20+
This method will be removed in a future release.
21+
1522
Ends the current authentication session. This function has no effect
1623
if the current session is not authenticated.
1724

source/reference/method/js-database.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Database Methods
130130

131131
* - :method:`db.logout()`
132132

133-
- Ends an authenticated session.
133+
- *Deprecated*. Ends an authenticated session.
134134

135135
* - :method:`db.printCollectionStats()`
136136

source/release-notes/5.0-compatibility.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,16 @@ General Changes
260260
- MongoDB 5.0 removes the ``--serviceExecutor`` command-line option and
261261
the corresponding ``net.serviceExecutor`` configuration option.
262262

263+
- Starting in MongoDB 5.0, you may not authenticate as multiple
264+
simultaneous users on the same client session if the
265+
:option:`--apiStrict` option is set. Attempting to
266+
authenticate as a new user while currently logged in as an existing
267+
user when the :option:`--apiStrict` option is set will generate an
268+
error message once per authentication attempt. If you are not using
269+
the :option:`--apiStrict` option, authenticating as a new user while
270+
currently logged in as an existing user will write a warning to the
271+
log once per authentication attempt.
272+
263273
Deprecations
264274
~~~~~~~~~~~~
265275

@@ -276,6 +286,17 @@ Deprecations
276286

277287
.. include:: /includes/deprecated-rs.printSlaveReplicationInfo.rst
278288

289+
- :dbcommand:`logout`
290+
291+
*Deprecated in version 5.0:* Disconnect from the server to end your
292+
session instead.
293+
294+
- :method:`db.logout()`
295+
296+
*Deprecated in version 5.0:* Disconnect from the server to end your
297+
session instead.
298+
299+
279300
.. _5.0-compatibility-enabled:
280301

281302
5.0 Feature Compatibility

0 commit comments

Comments
 (0)