diff --git a/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/security/jwt/JWTAuthenticator.java b/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/security/jwt/JWTAuthenticator.java index c938b01780..01ebcf6218 100644 --- a/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/security/jwt/JWTAuthenticator.java +++ b/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/security/jwt/JWTAuthenticator.java @@ -416,6 +416,8 @@ private void checkTokenEnvAgainstDeploymentType(String keyType, APIConfig matche if (System.getenv("DEPLOYMENT_TYPE_ENFORCED") != null && System.getenv("DEPLOYMENT_TYPE_ENFORCED").equalsIgnoreCase("false") && keyType.equalsIgnoreCase(APIConstants.JwtTokenConstants.PRODUCTION_KEY_TYPE)) { + log.info("Deprecated: Production access token is used to access sandbox API deployment in " + + "organization : " + matchedAPI.getOrganizationId()); if (!prodTokenNonProdAllowedOrgs.isEmpty()) { if (prodTokenNonProdAllowedOrgs.contains(matchedAPI.getOrganizationId())) { return; @@ -424,9 +426,6 @@ private void checkTokenEnvAgainstDeploymentType(String keyType, APIConfig matche APISecurityConstants.API_AUTH_INVALID_ENVIRONMENT, APISecurityConstants.API_AUTH_INVALID_ENVIRONMENT_ERROR_MESSAGE); } - - log.info("Deprecated: Production access token is used to access sandbox API deployment in " + - "organization : " + matchedAPI.getOrganizationId()); return; }