diff --git a/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/security/KeyValidator.java b/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/security/KeyValidator.java index c1d4896956..7436f3171e 100644 --- a/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/security/KeyValidator.java +++ b/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/security/KeyValidator.java @@ -160,20 +160,20 @@ public static APIKeyValidationInfoDTO validateSubscription(APIConfig apiConfig, String apiContextTemplate = apiContext.substring(0, lastIndexOfVersion); sub = datastore.getSubscriptionByAppIdApiContextVersionRange(app.getUUID(), apiContextTemplate, "v" + apiSemVersion.getMajor()); - if (sub == null) { - log.info( - "Valid subscription not found for oauth access token. application:" + - " {} app_UUID: {} API_Context:API_Version: {} API_UUID : {}", - app.getName(), app.getUUID(), apiContext + ":" + apiVersion, uuid); - } else { - log.debug("All information is retrieved from the in-memory data store."); - } } catch (EnforcerException e) { log.debug("API version: {} is not a valid semantic version", apiVersion); } } else { log.debug("All information is retrieved from the in-memory data store."); } + if (sub == null) { + log.info( + "Valid subscription not found for oauth access token. application:" + + " {} app_UUID: {} API_Context:API_Version: {} API_UUID : {}", + app.getName(), app.getUUID(), apiContext + ":" + apiVersion, uuid); + } else { + log.debug("All information is retrieved from the in-memory data store."); + } } else { log.info("Application not found in the data store for uuid " + key.getApplicationUUID()); } 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 fefc3392a6..5e831b9c54 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 @@ -300,13 +300,6 @@ public AuthenticationContext authenticate(RequestContext requestContext) throws AuthenticationContext authenticationContext = FilterUtils .generateAuthenticationContext(requestContext, jwtTokenIdentifier, validationInfo, apiKeyValidationInfoDTO, endUserToken, jwtToken, true); - //TODO: (VirajSalaka) Place the keytype population logic properly for self contained token - if (claims.getClaim("keytype") != null) { - authenticationContext.setKeyType(claims.getClaim("keytype").toString()); - } - // Check if the token has access to the gateway configured environment. - checkTokenEnvAgainstDeploymentType(requestContext.getAuthenticationContext().getKeyType(), - requestContext.getMatchedAPI()); if (!"Unlimited".equals(authenticationContext.getTier())) { // For subscription rate limiting, it is required to populate dynamic metadata String subscriptionId = authenticationContext.getApiUUID() + ":" +