File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ A standard connection string includes the following components:
54
54
- Required. A prefix that identifies this as a string in the
55
55
standard connection format.
56
56
57
- * - ``username:password ``
57
+ * - ``db_username:db_password ``
58
58
59
59
- Optional. Authentication credentials. If you include these, the client
60
60
authenticates the user against the database specified in ``authSource``.
@@ -69,7 +69,7 @@ A standard connection string includes the following components:
69
69
* - ``/defaultauthdb``
70
70
71
71
- Optional. The authentication database to use if the
72
- connection string includes ``username:password @``
72
+ connection string includes ``db_username:db_password @``
73
73
authentication credentials but not the ``authSource`` option. If you don't include
74
74
this component, the client authenticates the user against the ``admin`` database.
75
75
Original file line number Diff line number Diff line change 1
1
// start-scram-sha-256
2
- auto uri = mongocxx::uri(" mongodb://<username >:<password >@<hostname>:<port>/?"
2
+ auto uri = mongocxx::uri(" mongodb://<db_username >:<db_password >@<hostname>:<port>/?"
3
3
" authSource=admin&authMechanism=SCRAM-SHA-256" );
4
4
auto client = mongocxx::client(uri);
5
5
// end-scram-sha-256
6
6
7
7
// start-scram-sha-1
8
- auto uri = mongocxx::uri(" mongodb://<username >:<password >@<hostname>:<port>/?"
8
+ auto uri = mongocxx::uri(" mongodb://<db_username >:<db_password >@<hostname>:<port>/?"
9
9
" authSource=admin&authMechanism=SCRAM-SHA-1" );
10
10
auto client = mongocxx::client(uri);
11
11
// end-scram-sha-1
@@ -35,14 +35,14 @@ auto client = mongocxx::client(uri);
35
35
// end-aws-environment
36
36
37
37
// start-kerberos
38
- auto uri = mongocxx::uri(" mongodb://mongodbuser%40EXAMPLE.COM @<hostname>:<port>/?"
38
+ auto uri = mongocxx::uri(" mongodb://<Kerberos principal> @<hostname>:<port>/?"
39
39
" authMechanism=GSSAPI"
40
40
" &authMechanismProperties=SERVICE_NAME:<authentication service name>" );
41
41
auto client = mongocxx::client(uri);
42
42
// end-kerberos
43
43
44
44
// start-plain
45
- auto uri = mongocxx::uri(" mongodb://<username >:<password >@<hostname>:<port>/?"
45
+ auto uri = mongocxx::uri(" mongodb://<db_username >:<db_password >@<hostname>:<port>/?"
46
46
" authMechanism=PLAIN&tls=true" );
47
47
auto client = mongocxx::client(uri);
48
48
// end-plain
Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ running MongoDB v4.0 or later.
34
34
35
35
To authenticate with this mechanism, set the following connection options:
36
36
37
- - ``username ``: The username to authenticate.
38
- - ``password ``: The password to authenticate.
37
+ - ``db_username ``: The database username to authenticate.
38
+ - ``db_password ``: The database password to authenticate.
39
39
- ``authSource``: The MongoDB database to authenticate against. By default,
40
40
{+driver-short+} authenticates against the database in the connection
41
41
URI, if you include one. If you don't, it authenticates against the ``admin`` database.
@@ -61,8 +61,8 @@ running MongoDB v3.6.
61
61
62
62
To authenticate with this mechanism, set the following connection options:
63
63
64
- - ``username ``: The username to authenticate.
65
- - ``password ``: The password to authenticate.
64
+ - ``db_username ``: The username to authenticate.
65
+ - ``db_password ``: The password to authenticate.
66
66
- ``authSource``: The MongoDB database to authenticate against. By default,
67
67
{+driver-short+} authenticates against the ``admin`` database.
68
68
- ``authMechanism``: Set to ``"SCRAM-SHA-1"``.
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ Complete the following steps to authenticate with GSSAPI:
72
72
73
73
Next, set the following connection options:
74
74
75
- - ``username ``: The Kerbos principal to authenticate.
75
+ - ``Kerberos principal ``: The Kerberos principal to authenticate.
76
76
- ``authMechanism``: Set to ``"GSSAPI"``.
77
77
- ``authMechanismProperties``: Optional. By default, MongoDB uses ``mongodb`` as
78
78
the authentication service name. To specify a different service name, set
You can’t perform that action at this time.
0 commit comments