From 70d0e757eb5d52c05184ec749ff40a4683397f00 Mon Sep 17 00:00:00 2001 From: Thamindu Aluthwala Date: Thu, 26 Oct 2023 13:54:28 +0530 Subject: [PATCH] Address review comments --- .../auth/service/util/AuthConfigurationUtil.java | 3 +-- .../authz/service/handler/AuthorizationHandler.java | 9 +-------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/components/org.wso2.carbon.identity.auth.service/src/main/java/org/wso2/carbon/identity/auth/service/util/AuthConfigurationUtil.java b/components/org.wso2.carbon.identity.auth.service/src/main/java/org/wso2/carbon/identity/auth/service/util/AuthConfigurationUtil.java index f4ee47e3..3cb98204 100644 --- a/components/org.wso2.carbon.identity.auth.service/src/main/java/org/wso2/carbon/identity/auth/service/util/AuthConfigurationUtil.java +++ b/components/org.wso2.carbon.identity.auth.service/src/main/java/org/wso2/carbon/identity/auth/service/util/AuthConfigurationUtil.java @@ -189,8 +189,7 @@ private static OMElement getResourceAccessControlConfigs() { } catch (IOException e) { String message = "Error while reading Resource Access control configuration at: " + path.getFileName(); log.error(message); - } catch (XMLStreamException e - ) { + } catch (XMLStreamException e) { String message = "Error while parsing Resource Access control configuration at: " + path.getFileName(); log.error(message); } diff --git a/components/org.wso2.carbon.identity.authz.service/src/main/java/org/wso2/carbon/identity/authz/service/handler/AuthorizationHandler.java b/components/org.wso2.carbon.identity.authz.service/src/main/java/org/wso2/carbon/identity/authz/service/handler/AuthorizationHandler.java index 9afd10ed..f5b90e6c 100644 --- a/components/org.wso2.carbon.identity.authz.service/src/main/java/org/wso2/carbon/identity/authz/service/handler/AuthorizationHandler.java +++ b/components/org.wso2.carbon.identity.authz.service/src/main/java/org/wso2/carbon/identity/authz/service/handler/AuthorizationHandler.java @@ -77,15 +77,8 @@ public AuthorizationResult handleAuthorization(AuthorizationContext authorizatio if (isScopeValidationRequired(authorizationContext, validateScope)) { validateScopes(authorizationContext, authorizationResult, allowedScopes); } - else if (CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME) { - if (StringUtils.isNotBlank(permissionString) || authorizationContext.getRequiredScopes().size() == 0) { - validatePermissions(authorizationResult, user, permissionString, tenantUserRealm); - } - } else { - // TODO: Use OAuth2 scope validator, once merged. + if (StringUtils.isNotBlank(permissionString) || authorizationContext.getRequiredScopes().size() == 0) { validatePermissions(authorizationResult, user, permissionString, tenantUserRealm); - // authorizationResult.setAuthorizationStatus(AuthorizationStatus.GRANT); - } } catch (UserStoreException e) { String errorMessage = "Error occurred while trying to authorize, " + e.getMessage();