From 9e042b06b455ac2e5ef4081f8550efff85ecbf92 Mon Sep 17 00:00:00 2001 From: Pedro Igor Date: Mon, 21 Nov 2022 19:27:41 -0300 Subject: [PATCH] Avoid creating proxies at runtime for Rest-based SPIs Closes #15605 --- .../org/keycloak/authorization/admin/PolicyTypeService.java | 2 -- .../keycloak/services/resources/IdentityBrokerService.java | 4 +--- .../keycloak/services/resources/admin/RealmAdminResource.java | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/services/src/main/java/org/keycloak/authorization/admin/PolicyTypeService.java b/services/src/main/java/org/keycloak/authorization/admin/PolicyTypeService.java index 6d33d95f06..e0bfdb7dd4 100644 --- a/services/src/main/java/org/keycloak/authorization/admin/PolicyTypeService.java +++ b/services/src/main/java/org/keycloak/authorization/admin/PolicyTypeService.java @@ -54,8 +54,6 @@ public class PolicyTypeService extends PolicyService { return null; } - ResteasyProviderFactory.getInstance().injectProperties(resource); - return resource; } diff --git a/services/src/main/java/org/keycloak/services/resources/IdentityBrokerService.java b/services/src/main/java/org/keycloak/services/resources/IdentityBrokerService.java index 788d9b0fc3..0069d51d99 100755 --- a/services/src/main/java/org/keycloak/services/resources/IdentityBrokerService.java +++ b/services/src/main/java/org/keycloak/services/resources/IdentityBrokerService.java @@ -417,9 +417,7 @@ public class IdentityBrokerService implements IdentityProvider.AuthenticationCal throw new NotFoundException(e.getMessage()); } - Object callback = identityProvider.callback(realmModel, this, event); - ResteasyProviderFactory.getInstance().injectProperties(callback); - return callback; + return identityProvider.callback(realmModel, this, event); } @Path("{provider_id}/token") diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java index 8dcde4eb19..e5e66cd36c 100644 --- a/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java @@ -510,7 +510,6 @@ public class RealmAdminResource { if (provider != null) { Object resource = provider.getResource(session, realm, auth, adminEvent); if (resource != null) { - ResteasyProviderFactory.getInstance().injectProperties(resource); return resource; } }