From d83993d624b655af0e84090d07a25501487a7f96 Mon Sep 17 00:00:00 2001 From: sandushi Date: Mon, 17 Feb 2025 06:13:36 +0530 Subject: [PATCH 1/3] Upgrade nimbusds version to 9.37.3 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 22103405..734948bb 100644 --- a/pom.xml +++ b/pom.xml @@ -569,8 +569,8 @@ 4.1.3.wso2v1 [4.1.3.wso2v1,5.0) 1.5.3 - 7.3.0.wso2v1 - [7.3.0,8.0.0) + 9.37.3.wso2v1 + [9.0.0,11.0.0) 2.4.7 [2.3,3) 1.10.19 From 1d25931d75a79eacb0130a85a341aa42661c96f8 Mon Sep 17 00:00:00 2001 From: sandushi Date: Mon, 17 Feb 2025 10:05:44 +0530 Subject: [PATCH 2/3] Convert object inside the json object to json --- .../functions/jwt/decode/JwtDecodeImpl.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.jwt.decode/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/jwt/decode/JwtDecodeImpl.java b/components/org.wso2.carbon.identity.conditional.auth.functions.jwt.decode/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/jwt/decode/JwtDecodeImpl.java index fbf7fd48..64cba053 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.jwt.decode/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/jwt/decode/JwtDecodeImpl.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.jwt.decode/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/jwt/decode/JwtDecodeImpl.java @@ -26,6 +26,7 @@ import org.wso2.carbon.identity.application.authentication.framework.exception.FrameworkException; import java.text.ParseException; +import java.util.Map; /** * Represents javascript function provided in conditional authentication to decode a jwt assertion and retrieve @@ -68,12 +69,28 @@ public String getValueFromDecodedAssertion(String clientAssertion, String parame public JSONObject getDecodedAssertion(String encodedAssertion, boolean isParameterInPayload) throws ParseException { JWSObject plainObject; + Map resultMap; plainObject = JWSObject.parse(encodedAssertion); if (isParameterInPayload) { - return plainObject.getPayload().toJSONObject(); + resultMap = plainObject.getPayload().toJSONObject(); } else { - return plainObject.getHeader().toJSONObject(); + resultMap = plainObject.getHeader().toJSONObject(); + } + JSONObject jsonObject = new JSONObject(resultMap); + recursivelyConvertToJson(jsonObject); + return jsonObject; + } + + private void recursivelyConvertToJson(JSONObject jsonObject) { + + for (String key : jsonObject.keySet()) { + Object value = jsonObject.get(key); + if (value instanceof Map) { + // Recursively convert any Map to JSONObject + jsonObject.put(key, new JSONObject((Map) value)); + recursivelyConvertToJson((JSONObject) jsonObject.get(key)); + } } } From eb5073e3d38f0e8dbdfe23681f1ec9e90fc8d72d Mon Sep 17 00:00:00 2001 From: sandushi Date: Mon, 17 Feb 2025 14:25:42 +0530 Subject: [PATCH 3/3] Update the version range upper bound to 10.0.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 734948bb..4dd43cac 100644 --- a/pom.xml +++ b/pom.xml @@ -570,7 +570,7 @@ [4.1.3.wso2v1,5.0) 1.5.3 9.37.3.wso2v1 - [9.0.0,11.0.0) + [9.0.0,10.0.0) 2.4.7 [2.3,3) 1.10.19