Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[keyvault] Add remediation steps to challenge verification error message #23268

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/keyvault/keyvault-admin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Verify the challenge resource matches the vault domain.
This should affect few customers who can set `disableChallengeResourceVerification` in the options bag to `true` to disable.
See https://aka.ms/azsdk/blog/vault-uri for more information.

## 4.2.2 (2022-08-09)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ describe("Challenge based authentication tests", function () {
},
scopes: [],
}),
"Challenge resource host 'vault.azure.net' does not match request domain"
"The challenge resource 'vault.azure.net' does not match the requested domain. Set disableChallengeResourceVerification to true in your client options to disable. See https://aka.ms/azsdk/blog/vault-uri for more information."
);
});

Expand All @@ -179,7 +179,7 @@ describe("Challenge based authentication tests", function () {
},
scopes: [],
}),
"Challenge resource host 'vault.azure.net' does not match request domain"
"The challenge resource 'vault.azure.net' does not match the requested domain. Set disableChallengeResourceVerification to true in your client options to disable. See https://aka.ms/azsdk/blog/vault-uri for more information."
);
});

Expand All @@ -199,9 +199,7 @@ describe("Challenge based authentication tests", function () {
});

it("does not throw if the resource URI host does not match the request but verifyChallengeResource is false", async () => {
challengeCallbacks = createChallengeCallbacks({
disableChallengeResourceVerification: true,
});
challengeCallbacks = createChallengeCallbacks({ disableChallengeResourceVerification: true });
await challengeCallbacks.authorizeRequestOnChallenge!({
getAccessToken: () => Promise.resolve(null),
request: createPipelineRequest({ url: "https://foo.bar" }),
Expand Down
1 change: 1 addition & 0 deletions sdk/keyvault/keyvault-certificates/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Verify the challenge resource matches the vault domain.
This should affect few customers who can set `disableChallengeResourceVerification` in the options bag to `true` to disable.
See https://aka.ms/azsdk/blog/vault-uri for more information.

## 4.5.0 (2022-08-09)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ describe("Challenge based authentication tests", function () {
},
scopes: [],
}),
"Challenge resource host 'vault.azure.net' does not match request domain"
"The challenge resource 'vault.azure.net' does not match the requested domain. Set disableChallengeResourceVerification to true in your client options to disable. See https://aka.ms/azsdk/blog/vault-uri for more information."
);
});

Expand All @@ -179,7 +179,7 @@ describe("Challenge based authentication tests", function () {
},
scopes: [],
}),
"Challenge resource host 'vault.azure.net' does not match request domain"
"The challenge resource 'vault.azure.net' does not match the requested domain. Set disableChallengeResourceVerification to true in your client options to disable. See https://aka.ms/azsdk/blog/vault-uri for more information."
);
});

Expand All @@ -199,9 +199,7 @@ describe("Challenge based authentication tests", function () {
});

it("does not throw if the resource URI host does not match the request but verifyChallengeResource is false", async () => {
challengeCallbacks = createChallengeCallbacks({
disableChallengeResourceVerification: true,
});
challengeCallbacks = createChallengeCallbacks({ disableChallengeResourceVerification: true });
await challengeCallbacks.authorizeRequestOnChallenge!({
getAccessToken: () => Promise.resolve(null),
request: createPipelineRequest({ url: "https://foo.bar" }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function verifyChallengeResource(scope: string, request: PipelineRequest): void

if (!requestUrl.hostname.endsWith(`.${scopeAsUrl.hostname}`)) {
throw new Error(
`Challenge resource host '${scopeAsUrl.hostname}' does not match request domain`
`The challenge resource '${scopeAsUrl.hostname}' does not match the requested domain. Set disableChallengeResourceVerification to true in your client options to disable. See https://aka.ms/azsdk/blog/vault-uri for more information.`
);
}
}
Expand Down
1 change: 1 addition & 0 deletions sdk/keyvault/keyvault-keys/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Verify the challenge resource matches the vault domain.
This should affect few customers who can set `disableChallengeResourceVerification` in the options bag to `true` to disable.
See https://aka.ms/azsdk/blog/vault-uri for more information.

## 4.5.0 (2022-08-09)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ describe("Challenge based authentication tests", function () {
},
scopes: [],
}),
"Challenge resource host 'vault.azure.net' does not match request domain"
"The challenge resource 'vault.azure.net' does not match the requested domain. Set disableChallengeResourceVerification to true in your client options to disable. See https://aka.ms/azsdk/blog/vault-uri for more information."
);
});

Expand All @@ -179,7 +179,7 @@ describe("Challenge based authentication tests", function () {
},
scopes: [],
}),
"Challenge resource host 'vault.azure.net' does not match request domain"
"The challenge resource 'vault.azure.net' does not match the requested domain. Set disableChallengeResourceVerification to true in your client options to disable. See https://aka.ms/azsdk/blog/vault-uri for more information."
);
});

Expand Down
1 change: 1 addition & 0 deletions sdk/keyvault/keyvault-secrets/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Verify the challenge resource matches the vault domain.
This should affect few customers who can set `disableChallengeResourceVerification` in the options bag to `true` to disable.
See https://aka.ms/azsdk/blog/vault-uri for more information.

## 4.5.1 (2022-08-15)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ describe("Challenge based authentication tests", function () {
},
scopes: [],
}),
"Challenge resource host 'vault.azure.net' does not match request domain"
"The challenge resource 'vault.azure.net' does not match the requested domain. Set disableChallengeResourceVerification to true in your client options to disable. See https://aka.ms/azsdk/blog/vault-uri for more information."
);
});

Expand All @@ -179,7 +179,7 @@ describe("Challenge based authentication tests", function () {
},
scopes: [],
}),
"Challenge resource host 'vault.azure.net' does not match request domain"
"The challenge resource 'vault.azure.net' does not match the requested domain. Set disableChallengeResourceVerification to true in your client options to disable. See https://aka.ms/azsdk/blog/vault-uri for more information."
);
});

Expand Down