Skip to content

Commit

Permalink
Merge pull request #1696 from mohanachandran-s/release-1.3.0
Browse files Browse the repository at this point in the history
MOSIP-36480 - Synced the develop branch to release-1.3.0
  • Loading branch information
mohanachandran-s authored Dec 9, 2024
2 parents 7ecd8b1 + 7565ede commit 8645721
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 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() {

}


Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ public String constractBioIdentityRequest(String identityRequest, String bioValu
String transactionId = JsonPrecondtion.getValueFromJson(data, GlobalConstants.TRANSACTIONID);
String encryptedContent = encryptIsoBioValue(bioValue, timestamp, bioValueencryptionTemplateJson,
transactionId, isInternal);
String encryptedBioValue = JsonPrecondtion.getValueFromJson(encryptedContent, "encryptedData");


String encryptedBioValue = JsonPrecondtion.getValueFromJson(encryptedContent, "encryptedData");
logger.info(identityRequest);
String encryptedSessionKey = JsonPrecondtion.getValueFromJson(encryptedContent, "encryptedSessionKey");
identityRequest = JsonPrecondtion.parseAndReturnJsonContent(identityRequest, encryptedBioValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class GlobalMethods {
public static Set<String> serverEndpoints = new HashSet<>();

// Define the regex pattern to extract the domain and the path after the domain
private static final String module_name = "(mimoto|certify|signup|partnermanager|preregistration|resident|residentmobileapp|masterdata|esignet|idgenerator|policymanager|idauthentication|idrepository|auditmanager|authmanager)";
private static final String module_name = "(mimoto|certify|signup|partnermanager|preregistration|resident|residentmobileapp|masterdata|esignet|idgenerator|policymanager|idauthentication|idrepository|auditmanager|authmanager|keymanager)";
private static final String regex_1 = "https://([^/]+)/(v[0-9]+)?/" + module_name + "/([^,]+)";
private static final String regex_2 = "https://([^/]+)/" + module_name + "/(v[0-9]+)/([^,]+)";

Expand Down

0 comments on commit 8645721

Please sign in to comment.