Skip to content

Commit

Permalink
[ES-842] cherry pick the chages to skip id-field while Validatio of c…
Browse files Browse the repository at this point in the history
…hallenge request (mosip#699)

* add logic to skip id-field check with challenge

Signed-off-by: Mohd Kaif Siddique <mohdkaif.siddique@ad.infosys.com>

* added id-field into test.properties

Signed-off-by: Mohd Kaif Siddique <mohdkaif.siddique@ad.infosys.com>

---------

Signed-off-by: Mohd Kaif Siddique <mohdkaif.siddique@ad.infosys.com>
Co-authored-by: Mohd Kaif Siddique <mohdkaif.siddique@ad.infosys.com>
  • Loading branch information
kaifk468 and Mohd Kaif Siddique authored May 14, 2024
1 parent f1c2df9 commit d33b88d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public class AuthChallengeFactorFormatValidator implements ConstraintValidator<A
@Value("#{${mosip.esignet.authenticator.default.auth-factor.kba.field-details}}")
private List<Map<String, String>> fieldDetailList;

@Value("${mosip.esignet.authenticator.default.auth-factor.kba.individual-id-field}")
private String idField;

@Override
public boolean isValid(AuthChallenge authChallenge, ConstraintValidatorContext context) {
String authFactor = authChallenge.getAuthFactorType();
Expand Down Expand Up @@ -82,7 +85,7 @@ private boolean validateChallenge(String challenge) {
}

private boolean isValid(Map<String, String> fieldDetail, Map<String, String> challengeMap) {
if(fieldDetail.get("type").equals("text")) {
if(fieldDetail.get("type").equals("text") && !fieldDetail.get("id").equals(idField)) {
String value = challengeMap.get(fieldDetail.get("id"));
if(!StringUtils.hasText(value))
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ mosip.esignet.ui.config.key-values={'sbi.env': 'Developer', 'sbi.timeout.DISC':
'sbi.capture.count.iris': 1, 'sbi.capture.score.face': 70, 'sbi.capture.score.finger':70, 'sbi.capture.score.iris':70 }

mosip.esignet.authenticator.default.auth-factor.kba.field-details={{'id':'policyNumber', 'type':'text', 'format':'', 'maxLength': 50, 'regex': '^\\s*[+-]?(\\d+|\\d*\\.\\d+|\\d+\\.\\d*)([Ee][+-]?\\d*)?\\s*$'},{'id':'fullName', 'type':'text', 'format':'', 'maxLength': 50, 'regex': '^[A-Za-z\\s]{1,}[\\.]{0,1}[A-Za-z\\s]{0,}$'},{'id':'dob', 'type':'date', 'format':'dd/mm/yyyy'}}

mosip.esignet.authenticator.default.auth-factor.kba.individual-id-field=policyNumber
##----------------------------------------------------------------------------------------------------------------------
spring.autoconfigure.exclude[0]=org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration

Expand Down

0 comments on commit d33b88d

Please sign in to comment.