Skip to content

Commit

Permalink
refactor: jwt client authentication audience is now an issuer identif…
Browse files Browse the repository at this point in the history
…ier string

If needed this can be reverted using the `extras.clientAssertionPayload` option.
  • Loading branch information
panva committed Nov 22, 2024
1 parent e7380c0 commit 0b05217
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/helpers/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,14 @@ async function authFor(endpoint, { clientAssertionPayload } = {}) {
case 'private_key_jwt':
case 'client_secret_jwt': {
const timestamp = now();
const audience = [
...new Set([this.issuer.issuer, this.issuer.token_endpoint].filter(Boolean)),
];

const assertion = await clientAssertion.call(this, endpoint, {
iat: timestamp,
exp: timestamp + 60,
jti: random(),
iss: this.client_id,
sub: this.client_id,
aud: audience,
aud: this.issuer.issuer,
...clientAssertionPayload,
});

Expand Down

0 comments on commit 0b05217

Please sign in to comment.