83
*/
84
export function buildResourceRedemptionBody(clientId: string, clientSecret: string | undefined, idJag: string, resource: string | undefined, scopes: readonly string[]): URLSearchParams {
85
>
const body = new URLSearchParams();
oauth.ts
86
>
body.append('client_id', clientId);
87
>
if (clientSecret) {
88
>
body.append('client_secret', clientSecret);
89
>
}
90
>
body.append('grant_type', GRANT_TYPE_JWT_BEARER);
91
>
body.append('assertion', idJag);
92
>
if (resource) {
93
>
body.append('resource', resource);
94
>
}
95
>
if (scopes.length) {
96
>
body.append('scope', scopes.join(AUTH_SCOPE_SEPARATOR));
97
>
}
98
>
return body;
99
>
}
100
101
//#region types