diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d74a7ff..47e1396c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [unreleased] +### Features +- support client certificates on OAuth2 Requests (#802) + ## [6.15.1] ( 2024-08-22) ### Features - prefix output with name as fallback for title (AnWeber/vscode-httpyac#318) diff --git a/src/plugins/http/clientCertVariableReplacer.ts b/src/plugins/http/clientCertVariableReplacer.ts index f16e8029..1b53b38d 100644 --- a/src/plugins/http/clientCertVariableReplacer.ts +++ b/src/plugins/http/clientCertVariableReplacer.ts @@ -36,7 +36,7 @@ export async function clientCertVariableReplacer( return text; } -async function addClientCertificateForUrl( +export async function addClientCertificateForUrl( urlString: string, request: models.HttpRequest, context: models.ProcessorContext diff --git a/src/plugins/oauth2/flow/requestOpenIdInformation.ts b/src/plugins/oauth2/flow/requestOpenIdInformation.ts index 1a71ec21..d691c617 100644 --- a/src/plugins/oauth2/flow/requestOpenIdInformation.ts +++ b/src/plugins/oauth2/flow/requestOpenIdInformation.ts @@ -2,6 +2,7 @@ import { log } from '../../../io'; import * as io from '../../../io'; import type * as models from '../../../models'; import * as utils from '../../../utils'; +import { addClientCertificateForUrl } from '../../http'; export async function requestOpenIdInformation( request: models.HttpClientRequest | false, @@ -66,6 +67,8 @@ export async function addConfigRequestOptions( request.noRejectUnauthorized = !utils.toBoolean(context.config?.request?.rejectUnauthorized); } + await addClientCertificateForUrl(request.url, request, context); + if (config.interceptRequest) { await config.interceptRequest(request, context); }