Skip to content

Commit c12d0d1

Browse files
Mongosh OIDC-docs merge feature branch into master (#272)
* DOCSP-28126 OIDC mongosh options and connection (#267) * DOCSP-28126 add mongosh options * DOCSP-28126 empty * DOCSP-28126 empty * DOCSP-28126 Anna feedback * DOCSP-28126 empty * DOCSP-28126 empty * DOCSP-28126 empty * DOCSP-28126 internal and external feedback * DOCSP-29126 updates * DOCSP-28126 updates * oidc-docs * oidc-docs fix ref to link * oidc-docs fix ref to link * oidc-docs fix ref to link * oidc-docs working on ref * oidc-docs working on ref * oidc-docs working on ref * oidc-docs working on ref
1 parent 5ec5b21 commit c12d0d1

File tree

2 files changed

+68
-1
lines changed

2 files changed

+68
-1
lines changed

source/connect.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,19 @@ option for programmatic usage of ``mongosh``, like a :driver:`driver
122122
- To provision access to a MongoDB deployment, see :manual:`Database
123123
Users </core/security-users/>`.
124124

125+
Connect with OpenID Connect
126+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
127+
128+
To connect to a deployment using :manual:`OpenID Connect </core/security-oidc/>`,
129+
use the :option:`--authenticationMechanism` option and set it to ``MONGODB-OIDC``.
130+
``mongosh`` redirects you to a browser where you enter your identity provider's
131+
log-in information.
132+
133+
For example, the following connects to a local deployment using ``MONGODB-OIDC``:
134+
135+
.. code-block:: sh
136+
137+
mongosh "mongodb://localhost/" --authenticationMechanism MONGODB-OIDC
125138

126139
Connect with LDAP
127140
~~~~~~~~~~~~~~~~~
@@ -198,7 +211,7 @@ Option 2: Specify Members in Connection String
198211
``````````````````````````````````````````````
199212

200213
You can specify individual replica set members in the
201-
:manual:`connection string </reference/connection-string>`.
214+
:manual:`connection string </reference/connection-string>`.
202215

203216
For example, to connect to a three-member replica set named ``replA``,
204217
run the following command:

source/reference/options.txt

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,12 @@ Authentication Options
436436
`MongoDB Enterprise
437437
<http://www.mongodb.com/products/mongodb-enterprise-advanced?jmp=docs>`_.
438438

439+
* - :manual:`MONGODB-OIDC </core/security-oidc/>` (OpenID Connect)
440+
441+
- External authentication using OpenID Connect. This mechanism is
442+
available only in `MongoDB Enterprise
443+
<http://www.mongodb.com/products/mongodb-enterprise-advanced?jmp=docs>`_.
444+
439445
.. option:: --gssapiServiceName
440446

441447
Specify the name of the service using
@@ -463,6 +469,54 @@ Authentication Options
463469
- ``none``, the effect is the same as setting
464470
``authMechanismProperties=CANONICALIZE_HOST_NAME:false``.
465471

472+
.. option:: --oidcFlows
473+
474+
Specifies OpenID Connect flows in a comma-separated list.
475+
The OpenID Connect flows specify how ``mongosh`` interacts with the identity
476+
provider for the authentication process. ``mongosh`` supports the following
477+
OpenID Connect flows:
478+
479+
.. list-table::
480+
:header-rows: 1
481+
:widths: 25 75
482+
483+
* - OpenID Connect Flow
484+
- Description
485+
486+
* - ``auth-code``
487+
- Default. ``mongosh`` opens a browser and redirects you to the identity
488+
provider log-in screen.
489+
490+
* - ``device-auth``
491+
- ``mongosh`` provides you with a URL and code to finish authentication.
492+
This is considered a less secure OpenID Connect flow but can be used when
493+
``mongosh`` is run in an environment in which it cannot open a browser.
494+
495+
To set ``device-auth`` as a fallback option to ``auth-code``, see the following
496+
example:
497+
498+
.. code-block:: bash
499+
500+
mongosh 'mongodb://localhost/' --authenticationMechanism MONGODB-OIDC --oidcFlows=auth-code,device-auth
501+
502+
.. option:: --oidcRedirectUri
503+
504+
Specifies a URI where the identity provider redirects you after authentication.
505+
The URI must match the configuration of the identity provider.
506+
The default is ``http://localhost:27097/redirect``.
507+
508+
.. option:: --oidcTrustedEndpoint
509+
510+
Specifies a connection to a trusted endpoint that is not Atlas or localhost.
511+
Only use this option when connecting to servers that you trust.
512+
513+
.. option:: --browser
514+
515+
Specifies the browser ``mongosh`` redirects you to when ``MONGODB-OIDC``
516+
is enabled.
517+
518+
This option is run with the system shell.
519+
466520
.. option:: --password <password>, -p <password>
467521

468522
Specifies a password with which to authenticate to a MongoDB database

0 commit comments

Comments
 (0)