Skip to content

Commit

Permalink
Also accept 'xurrent' as JWT issuer if '4me' is configured
Browse files Browse the repository at this point in the history
  • Loading branch information
Fried Hoeben committed Jan 14, 2025
1 parent b5e3ea9 commit e7b4d95
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
7 changes: 6 additions & 1 deletion library/helpers/js_4me_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,17 @@ class Js4meHelper {
async get4meData(token) {
const cryptoKeyObj = crypto.createPublicKey(this.certStr);

const iss = [this.issuer];
if (this.env4me.includes('4me')) {
iss.push(`https://${this.account}.${this.env4me.replace('4me', 'xurrent')}`);
}

try {
const {payload, protectedHeader} = await jwtVerify(
token,
cryptoKeyObj,
{
issuer: this.issuer,
issuer: iss,
algorithms: [this.algorithm],
audience: this.audience,
}
Expand Down
13 changes: 12 additions & 1 deletion library/helpers/tests/js_4me_helper_jwt_verification.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e7b4d95

Please sign in to comment.