Skip to content

Commit

Permalink
fix connection close issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaminduR committed Oct 25, 2023
1 parent 8220187 commit ab97cbc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ private List<AuthenticationHandler> filterAuthenticationHandlers(AuthenticationC
private boolean isHandlerAllowedForResource(List<String> allowedAuthenticationHandlersForResource,
AuthenticationHandler handler) {

if (handler.getName().equals(Constants.BASIC_AUTHENTICATION) &&
Boolean.parseBoolean(IdentityUtil.getProperty(Constants.ENABLE_BASIC_AUTH_HANDLER_CONFIG))) {
if (Constants.BASIC_AUTHENTICATION.equals(handler.getName()) &&
!Boolean.parseBoolean(IdentityUtil.getProperty(Constants.ENABLE_BASIC_AUTH_HANDLER_CONFIG))) {
return false;
}
return allowedAuthenticationHandlersForResource.contains(handler.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private static OMElement getResourceAccessControlConfigs() {
if (Files.exists(path)) {
try (InputStream in = Files.newInputStream(path)) {
StAXOMBuilder builder = new StAXOMBuilder(in);
return builder.getDocumentElement();
return builder.getDocumentElement().cloneOMElement();
} catch (IOException e) {
String message = "Error while reading Resource Access control configuration at: " + path.getFileName();
log.error(message);
Expand All @@ -194,6 +194,8 @@ private static OMElement getResourceAccessControlConfigs() {
String message = "Error while parsing Resource Access control configuration at: " + path.getFileName();
log.error(message);
}
} else {
log.error("Resource Access control configuration not found at: " + path.getFileName());
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ else if (CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME) {
}
} else {
// TODO: Use OAuth2 scope validator, once merged.
validateScopes(authorizationContext, authorizationResult, allowedScopes);
validatePermissions(authorizationResult, user, permissionString, tenantUserRealm);
// authorizationResult.setAuthorizationStatus(AuthorizationStatus.GRANT);

}
} catch (UserStoreException e) {
String errorMessage = "Error occurred while trying to authorize, " + e.getMessage();
Expand Down

0 comments on commit ab97cbc

Please sign in to comment.