From 972a5de8c701524b5bc928bde21cbba9d99e394b Mon Sep 17 00:00:00 2001 From: Pedro Igor Date: Tue, 20 Dec 2022 04:23:44 -0800 Subject: [PATCH] Add a META-INF/beans.xml file to enable support for JAX-RS (#4074) Closes #4073 --- .gitignore | 4 ++++ .../admin/ui/rest/AuthenticationManagementResource.java | 7 ++++--- .../keycloak/admin/ui/rest/BruteForceUsersResource.java | 1 - keycloak-theme/src/main/resources/META-INF/beans.xml | 0 4 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 keycloak-theme/src/main/resources/META-INF/beans.xml diff --git a/.gitignore b/.gitignore index d1b7236720..f4907d6260 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,7 @@ server dist dist-ssr *.local + +# Intellij +.idea +*.iml diff --git a/keycloak-theme/src/main/java/org/keycloak/admin/ui/rest/AuthenticationManagementResource.java b/keycloak-theme/src/main/java/org/keycloak/admin/ui/rest/AuthenticationManagementResource.java index fdd0c14413..b2b6eec074 100644 --- a/keycloak-theme/src/main/java/org/keycloak/admin/ui/rest/AuthenticationManagementResource.java +++ b/keycloak-theme/src/main/java/org/keycloak/admin/ui/rest/AuthenticationManagementResource.java @@ -27,9 +27,6 @@ import org.keycloak.models.utils.DefaultAuthenticationFlows; import org.keycloak.services.resources.admin.permissions.AdminPermissionEvaluator; -@Path("/") -@Consumes({"application/json"}) -@Produces({"application/json"}) public class AuthenticationManagementResource extends RoleMappingResource { private final KeycloakSession session; @@ -45,6 +42,8 @@ public class AuthenticationManagementResource extends RoleMappingResource { @GET @Path("/flows") + @Consumes({"application/json"}) + @Produces({"application/json"}) @Operation( summary = "List all authentication flows for this realm", description = "This endpoint returns all the authentication flows and lists if there they are used." @@ -72,6 +71,8 @@ public class AuthenticationManagementResource extends RoleMappingResource { @GET @Path("/{type}/{id}") + @Consumes({"application/json"}) + @Produces({"application/json"}) @Operation( summary = "List all clients or identity providers that this flow is used by", description = "List all the clients or identity providers this flow is used by as a paginated list" diff --git a/keycloak-theme/src/main/java/org/keycloak/admin/ui/rest/BruteForceUsersResource.java b/keycloak-theme/src/main/java/org/keycloak/admin/ui/rest/BruteForceUsersResource.java index 61d6bbc49c..8131865990 100644 --- a/keycloak-theme/src/main/java/org/keycloak/admin/ui/rest/BruteForceUsersResource.java +++ b/keycloak-theme/src/main/java/org/keycloak/admin/ui/rest/BruteForceUsersResource.java @@ -30,7 +30,6 @@ import org.keycloak.services.resources.admin.permissions.AdminPermissionEvaluato import org.keycloak.services.resources.admin.permissions.UserPermissionEvaluator; import org.keycloak.utils.SearchQueryUtils; -@Path("/") public class BruteForceUsersResource { private static final Logger logger = Logger.getLogger(BruteForceUsersResource.class); private static final String SEARCH_ID_PARAMETER = "id:"; diff --git a/keycloak-theme/src/main/resources/META-INF/beans.xml b/keycloak-theme/src/main/resources/META-INF/beans.xml new file mode 100644 index 0000000000..e69de29bb2