@@ -957,7 +957,9 @@ Examples are provided below.
957
957
958
958
- AWS_SESSION_TOKEN
959
959
960
- Drivers MUST allow the user to specify an AWS session token for authentication with temporary credentials.
960
+ Drivers MAY allow an AWS session token for authentication with temporary credentials to exist in their API,
961
+ internally, but MUST raise an error if the user provided it explicitly via the URI or client options. This
962
+ property MUST NOT exist in the public API.
961
963
962
964
- AWS_CREDENTIAL_PROVIDER
963
965
@@ -1011,11 +1013,10 @@ Drivers MAY expose API for default providers for the following scenarios when ap
1011
1013
1012
1014
The order in which Drivers MUST search for credentials is:
1013
1015
1014
- 1. The URI
1015
- 2. A custom AWS credential provider if the driver supports it.
1016
- 3. Environment variables
1017
- 4. Using `AssumeRoleWithWebIdentity` if `AWS_WEB_IDENTITY_TOKEN_FILE` and `AWS_ROLE_ARN` are set.
1018
- 5. The ECS endpoint if `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is set. Otherwise, the EC2 endpoint.
1016
+ 1. A custom AWS credential provider if the driver supports it.
1017
+ 2. Environment variables
1018
+ 3. Using `AssumeRoleWithWebIdentity` if `AWS_WEB_IDENTITY_TOKEN_FILE` and `AWS_ROLE_ARN` are set.
1019
+ 4. The ECS endpoint if `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is set. Otherwise, the EC2 endpoint.
1019
1020
1020
1021
> [!NOTE]
1021
1022
> See *Should drivers support accessing Amazon EC2 instance metadata in Amazon ECS* in [Q & A](#q-and-a)
@@ -1025,32 +1026,16 @@ The order in which Drivers MUST search for credentials is:
1025
1026
> description of `AssumeRole` below, which is distinct from `AssumeRoleWithWebIdentity` requests that are meant to be
1026
1027
> handled directly by the driver.
1027
1028
1028
- ##### URI
1029
-
1030
- An example URI for authentication with MONGODB-AWS using AWS IAM credentials passed through the URI is as follows:
1031
-
1032
- ```javascript
1033
- "mongodb://<access_key>:<secret_key>@mongodb.example.com/?authMechanism=MONGODB-AWS"
1034
- ```
1035
-
1036
- Users MAY have obtained temporary credentials through an
1037
- [AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) request. If so, then in addition
1038
- to a username and password, users MAY also provide an `AWS_SESSION_TOKEN` as a `mechanism_property`.
1039
-
1040
- ```javascript
1041
- "mongodb://<access_key>:<secret_key>@mongodb.example.com/?authMechanism=MONGODB-AWS&authMechanismProperties=AWS_SESSION_TOKEN:<security_token>"
1042
- ```
1043
-
1044
1029
##### Environment variables
1045
1030
1046
1031
AWS Lambda runtimes set several
1047
1032
[environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime)
1048
1033
during initialization. To support AWS Lambda runtimes Drivers MUST check a subset of these variables, i.e.,
1049
1034
`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN`, for the access key ID, secret access key and
1050
- session token, respectively if AWS credentials are not explicitly provided in the URI. The `AWS_SESSION_TOKEN` may or
1051
- may not be set. However, if `AWS_SESSION_TOKEN` is set Drivers MUST use its value as the session token. Drivers
1052
- implemented in programming languages that support altering environment variables MUST always read environment variables
1053
- dynamically during authorization, to handle the case where another part the application has refreshed the credentials.
1035
+ session token, respectively. The `AWS_SESSION_TOKEN` may or may not be set. However, if `AWS_SESSION_TOKEN` is set Drivers
1036
+ MUST use its value as the session token. Drivers implemented in programming languages that support altering environment
1037
+ variables MUST always read environment variables dynamically during authorization, to handle the case where another part the
1038
+ application has refreshed the credentials.
1054
1039
1055
1040
However, if environment variables are not present during initial authorization, credentials may be fetched from another
1056
1041
source and cached. Even if the environment variables are present in subsequent authorization attempts, the driver MUST
@@ -2165,6 +2150,8 @@ practice to avoid this. (See
2165
2150
2166
2151
## Changelog
2167
2152
2153
+ - 2025-09-30: Remove credentials URI support for MONGODDB-AWS.
2154
+
2168
2155
- 2025-09-10: Update precedence of MONGODB-AWS credential fetching behaviour.
2169
2156
2170
2157
- 2025-01-29: Add support for custom AWS credential providers.
0 commit comments