Skip to content

Commit

Permalink
test: fix azure validation
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Feb 14, 2024
1 parent 8a5c7ec commit 3655e9e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/cmap/auth/mongo_credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}'.`
);
}

Expand Down

0 comments on commit 3655e9e

Please sign in to comment.