diff --git a/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/validator/AuthRequestValidator.java b/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/validator/AuthRequestValidator.java index e3e801d7b4a..769561313d4 100644 --- a/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/validator/AuthRequestValidator.java +++ b/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/validator/AuthRequestValidator.java @@ -17,6 +17,7 @@ import javax.annotation.PostConstruct; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Component; import org.springframework.validation.Errors; @@ -76,6 +77,9 @@ public class AuthRequestValidator extends BaseAuthRequestValidator { */ private List allowedDomainUris; + @Value("${mosip.ida.validate-env-disabled:false}") + private boolean isEnvValidationDisabled; + @PostConstruct public void initialize() { allowedEnvironments = Arrays.stream(EnvUtil.getAllowedEnv().split((","))) @@ -645,9 +649,12 @@ private Date biometricTimestampParser(String timestamp) throws ParseException { * @return */ private boolean isValuesContainsIgnoreCase(List values, String value) { - if (value != null) { - return values.stream().anyMatch(value::equalsIgnoreCase); + if (!isEnvValidationDisabled) { + if (value != null) { + return values.stream().anyMatch(value::equalsIgnoreCase); + } + return false; } - return false; + return true; } } \ No newline at end of file