Skip to content

Commit 3655e9e

Browse files
committed
test: fix azure validation
1 parent 8a5c7ec commit 3655e9e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/cmap/auth/mongo_credentials.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,13 @@ export class MongoCredentials {
182182
}
183183

184184
if (this.mechanism === AuthMechanism.MONGODB_OIDC) {
185-
if (this.username && this.mechanismProperties.PROVIDER_NAME) {
185+
if (
186+
this.username &&
187+
this.mechanismProperties.PROVIDER_NAME &&
188+
this.mechanismProperties.PROVIDER_NAME !== 'azure'
189+
) {
186190
throw new MongoInvalidArgumentError(
187-
`username and PROVIDER_NAME may not be used together for mechanism '${this.mechanism}'.`
191+
`username and PROVIDER_NAME '${this.mechanismProperties.PROVIDER_NAME}' may not be used together for mechanism '${this.mechanism}'.`
188192
);
189193
}
190194

0 commit comments

Comments
 (0)