Add audience parameter to OAuth 2

Closes https://feedback.yaak.app/p/how-do-i-send-an-audience-using-oauth2
This commit is contained in:
Gregory Schier
2025-05-16 07:17:22 -07:00
parent 8c0f889dd2
commit 9615d3e29b
6 changed files with 26 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ export async function getAccessToken(
ctx: Context, {
accessTokenUrl,
scope,
audience,
params,
grantType,
credentialsInBody,
@@ -17,6 +18,7 @@ export async function getAccessToken(
grantType: string;
accessTokenUrl: string;
scope: string | null;
audience: string | null;
credentialsInBody: boolean;
params: HttpUrlParameter[];
}): Promise<AccessTokenRawResponse> {
@@ -39,6 +41,7 @@ export async function getAccessToken(
};
if (scope) httpRequest.body!.form.push({ name: 'scope', value: scope });
if (scope) httpRequest.body!.form.push({ name: 'audience', value: audience });
if (credentialsInBody) {
httpRequest.body!.form.push({ name: 'client_id', value: clientId });