From 3655e9e7f9f86d38058ae90f5438a634bf421cb8 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Wed, 7 Feb 2024 22:40:39 +0100 Subject: [PATCH] test: fix azure validation --- src/cmap/auth/mongo_credentials.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cmap/auth/mongo_credentials.ts b/src/cmap/auth/mongo_credentials.ts index fa2f5a6082c..592a910a340 100644 --- a/src/cmap/auth/mongo_credentials.ts +++ b/src/cmap/auth/mongo_credentials.ts @@ -182,9 +182,13 @@ export class MongoCredentials { } if (this.mechanism === AuthMechanism.MONGODB_OIDC) { - if (this.username && this.mechanismProperties.PROVIDER_NAME) { + if ( + this.username && + this.mechanismProperties.PROVIDER_NAME && + this.mechanismProperties.PROVIDER_NAME !== 'azure' + ) { throw new MongoInvalidArgumentError( - `username and PROVIDER_NAME may not be used together for mechanism '${this.mechanism}'.` + `username and PROVIDER_NAME '${this.mechanismProperties.PROVIDER_NAME}' may not be used together for mechanism '${this.mechanism}'.` ); }