59
*/
60
export function buildIdJagExchangeBody(clientId: string, clientSecret: string | undefined, idToken: string, audience: string, resource: string | undefined, scopes: readonly string[]): URLSearchParams {
61
>
const body = new URLSearchParams();
oauth.ts
62
>
body.append('client_id', clientId);
63
>
if (clientSecret) {
64
body.append('client_secret', clientSecret);
65
}
66
>
body.append('grant_type', GRANT_TYPE_TOKEN_EXCHANGE);
oauth.ts
67
>
body.append('subject_token', idToken);
68
>
body.append('subject_token_type', TOKEN_TYPE_ID_TOKEN);
69
>
body.append('requested_token_type', TOKEN_TYPE_ID_JAG);
70
>
body.append('audience', audience);
71
>
if (resource) {
72
body.append('resource', resource);
73
}
75
body.append('scope', scopes.join(AUTH_SCOPE_SEPARATOR));
76
}
78
>
}
79
80
/**