diff --git a/source/connect/client.txt b/source/connect/client.txt index 23b82b9b..93f74e5b 100644 --- a/source/connect/client.txt +++ b/source/connect/client.txt @@ -54,7 +54,7 @@ A standard connection string includes the following components: - Required. A prefix that identifies this as a string in the standard connection format. - * - ``username:password`` + * - ``db_username:db_password`` - Optional. Authentication credentials. If you include these, the client authenticates the user against the database specified in ``authSource``. @@ -69,7 +69,7 @@ A standard connection string includes the following components: * - ``/defaultauthdb`` - Optional. The authentication database to use if the - connection string includes ``username:password@`` + connection string includes ``db_username:db_password@`` authentication credentials but not the ``authSource`` option. If you don't include this component, the client authenticates the user against the ``admin`` database. diff --git a/source/includes/authentication.cpp b/source/includes/authentication.cpp index 3e072ce9..d4aa5ead 100644 --- a/source/includes/authentication.cpp +++ b/source/includes/authentication.cpp @@ -1,11 +1,11 @@ // start-scram-sha-256 -auto uri = mongocxx::uri("mongodb://:@:/?" +auto uri = mongocxx::uri("mongodb://:@:/?" "authSource=admin&authMechanism=SCRAM-SHA-256"); auto client = mongocxx::client(uri); // end-scram-sha-256 // start-scram-sha-1 -auto uri = mongocxx::uri("mongodb://:@:/?" +auto uri = mongocxx::uri("mongodb://:@:/?" "authSource=admin&authMechanism=SCRAM-SHA-1"); auto client = mongocxx::client(uri); // end-scram-sha-1 @@ -35,14 +35,14 @@ auto client = mongocxx::client(uri); // end-aws-environment // start-kerberos -auto uri = mongocxx::uri("mongodb://mongodbuser%40EXAMPLE.COM@:/?" +auto uri = mongocxx::uri("mongodb://@:/?" "authMechanism=GSSAPI" "&authMechanismProperties=SERVICE_NAME:"); auto client = mongocxx::client(uri); // end-kerberos // start-plain -auto uri = mongocxx::uri("mongodb://:@:/?" +auto uri = mongocxx::uri("mongodb://:@:/?" "authMechanism=PLAIN&tls=true"); auto client = mongocxx::client(uri); // end-plain \ No newline at end of file diff --git a/source/security/authentication.txt b/source/security/authentication.txt index a52622fa..b09f17c4 100644 --- a/source/security/authentication.txt +++ b/source/security/authentication.txt @@ -34,8 +34,8 @@ running MongoDB v4.0 or later. To authenticate with this mechanism, set the following connection options: -- ``username``: The username to authenticate. -- ``password``: The password to authenticate. +- ``db_username``: The database username to authenticate. +- ``db_password``: The database password to authenticate. - ``authSource``: The MongoDB database to authenticate against. By default, {+driver-short+} authenticates against the database in the connection URI, if you include one. If you don't, it authenticates against the ``admin`` database. @@ -61,8 +61,8 @@ running MongoDB v3.6. To authenticate with this mechanism, set the following connection options: -- ``username``: The username to authenticate. -- ``password``: The password to authenticate. +- ``db_username``: The username to authenticate. +- ``db_password``: The password to authenticate. - ``authSource``: The MongoDB database to authenticate against. By default, {+driver-short+} authenticates against the ``admin`` database. - ``authMechanism``: Set to ``"SCRAM-SHA-1"``. diff --git a/source/security/enterprise-authentication.txt b/source/security/enterprise-authentication.txt index dd95017d..113e9f1e 100644 --- a/source/security/enterprise-authentication.txt +++ b/source/security/enterprise-authentication.txt @@ -72,7 +72,7 @@ Complete the following steps to authenticate with GSSAPI: Next, set the following connection options: - - ``username``: The Kerbos principal to authenticate. + - ``Kerberos principal``: The Kerberos principal to authenticate. - ``authMechanism``: Set to ``"GSSAPI"``. - ``authMechanismProperties``: Optional. By default, MongoDB uses ``mongodb`` as the authentication service name. To specify a different service name, set