-
Type: Bug
-
Resolution: Duplicate
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: Lambda
-
Empty show more show less
-
Not Needed
What problem are you facing?
I'm currently connecting to MongoDB on the Vercel platform and I can't authenticate using our AWS credentials because Vercel is using AWS Lambdas and AWS_SESSION_TOKEN is present in the environment. These credentials are reserved and we shouldn't touch them or use them.
This was working in a previous version 3.6.5 with the following connection string:
const mongodbUrl = `${process.env.MONGODB_URL}?authMechanismProperties=AWS_SESSION_TOKEN:false`
What driver and relevant dependency versions are you using?
3.6.10
Steps to reproduce?
Try authenticate using the authMechanism: "MONGODB-AWS" and populate process.env.AWS_SESSION_TOKEN with an invalid session token and set the connection url with either:
authMechanismProperties=AWS_SESSION_TOKEN:false
authMechanismProperties=AWS_SESSION_TOKEN:
The driver won't accept these as real values and will pick AWS_SESSION_TOKEN instead even though an empty string is a valid value yo be given.
A stricter check would allow these cases.
(this.mechanismProperties.AWS_SESSION_TOKEN === undefined && process.env.AWS_SESSION_TOKEN)
- duplicates
-
NODE-3487 AuthMechanism "MONGODB-AWS" doesn't allow me to set an empty value
- Closed