Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/open-moments-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@asgardeo/javascript': patch
'@asgardeo/browser': patch
'@asgardeo/node': patch
---

fix multiple audiences in ID token validation.Change audience parameter from string to array to support tokens with
multiple audiences
2 changes: 1 addition & 1 deletion packages/browser/src/__legacy__/utils/crypto-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class SPACryptoUtils implements Crypto<Buffer | string> {
): Promise<boolean> {
const jwtVerifyOptions = {
algorithms: algorithms,
audience: clientId,
audience: [clientId],
clockTolerance: clockTolerance,
subject: subject,
};
Expand Down
2 changes: 1 addition & 1 deletion packages/javascript/src/DefaultCrypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class DefaultCrypto implements Crypto<Uint8Array> {

await jose.jwtVerify(idToken, key, {
algorithms,
audience: clientId,
audience: [clientId],
clockTolerance,
issuer: validateJwtIssuer ? issuer : undefined,
subject,
Expand Down
2 changes: 1 addition & 1 deletion packages/node/src/__legacy__/utils/crypto-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class NodeCryptoUtils implements Crypto<Buffer | string> {
return jose
.jwtVerify(idToken, key, {
algorithms,
audience: clientId,
audience: [clientId],
clockTolerance,
issuer,
subject,
Expand Down