diff --git a/backend/src/services/identity-jwt-auth/identity-jwt-auth-fns.ts b/backend/src/services/identity-jwt-auth/identity-jwt-auth-fns.ts index 40fc87787..57aa933d6 100644 --- a/backend/src/services/identity-jwt-auth/identity-jwt-auth-fns.ts +++ b/backend/src/services/identity-jwt-auth/identity-jwt-auth-fns.ts @@ -1,9 +1,13 @@ import picomatch from "picomatch"; -export const doesFieldValueMatchJwtPolicy = (fieldValue: string | boolean, policyValue: string) => { +export const doesFieldValueMatchJwtPolicy = (fieldValue: string | boolean | number, policyValue: string) => { if (typeof fieldValue === "boolean") { return fieldValue === (policyValue === "true"); } + if (typeof fieldValue === "number") { + return fieldValue === parseInt(policyValue, 10); + } + return policyValue === fieldValue || picomatch.isMatch(fieldValue, policyValue); }; diff --git a/backend/src/services/identity-jwt-auth/identity-jwt-auth-service.ts b/backend/src/services/identity-jwt-auth/identity-jwt-auth-service.ts index 35c40643c..5f8fc5ff6 100644 --- a/backend/src/services/identity-jwt-auth/identity-jwt-auth-service.ts +++ b/backend/src/services/identity-jwt-auth/identity-jwt-auth-service.ts @@ -75,7 +75,7 @@ export const identityJwtAuthServiceFactory = ({ }); } - let tokenData: Record = {}; + let tokenData: Record = {}; if (identityJwtAuth.configurationType === JwtConfigurationType.JWKS) { const decryptedJwksCaCert = orgDataKeyDecryptor({