Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
nandhu-kumar committed Dec 7, 2024
2 parents c9f34b2 + a03c89f commit 3b0e2a6
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4031,21 +4031,25 @@ public String inputJsonKeyWordHandeler(String jsonString, String testCaseName) {
signJWKForMock(clientId, accessToken, oidcJWKKey4, testCaseName, tempUrl));
}

if (jsonString.contains(GlobalConstants.IDT_TOKEN) && jsonString.contains("$IDTINDIVIUALID$") && jsonString.contains("$IDTCHALLENGE$")) {
if (jsonString.contains(GlobalConstants.IDT_TOKEN)) {

JSONObject request = new JSONObject(jsonString);
String idtToken = request.get(GlobalConstants.IDT_TOKEN).toString();
request.remove(GlobalConstants.IDT_TOKEN);
jsonString = request.toString();

Map<String, String> map = new HashMap<>();
map.put(GlobalConstants.TOKEN, idtToken);
JSONObject encodingToken = new JSONObject(map);

String challenge = encodeBase64(encodingToken.toString());
String individualId = getSubjectFromJwt(idtToken);
if (jsonString.contains("$IDTINDIVIUALID$")) {
String individualId = getSubjectFromJwt(idtToken);
jsonString = replaceKeywordWithValue(jsonString, "$IDTINDIVIUALID$", individualId);
}

jsonString = replaceKeywordWithValue(jsonString, "$IDTINDIVIUALID$", individualId);
jsonString = replaceKeywordWithValue(jsonString, "$IDTCHALLENGE$", challenge);
if (jsonString.contains("$IDTCHALLENGE$")) {
String challenge = encodeBase64(encodingToken.toString());
jsonString = replaceKeywordWithValue(jsonString, "$IDTCHALLENGE$", challenge);
}

}

Expand Down Expand Up @@ -8225,4 +8229,3 @@ public static JSONArray getRequiredField() {

}


0 comments on commit 3b0e2a6

Please sign in to comment.