diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/RealmResource.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/RealmResource.java index c6a1edb57b..ffcd1787fb 100644 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/RealmResource.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/RealmResource.java @@ -29,6 +29,7 @@ import org.keycloak.representations.idm.RealmRepresentation; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; +import javax.ws.rs.FormParam; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; @@ -179,11 +180,11 @@ public interface RealmResource { AttackDetectionResource attackDetection(); @Path("testLDAPConnection") - @GET + @POST @NoCache - Response testLDAPConnection(@QueryParam("action") String action, @QueryParam("connectionUrl") String connectionUrl, - @QueryParam("bindDn") String bindDn, @QueryParam("bindCredential") String bindCredential, - @QueryParam("useTruststoreSpi") String useTruststoreSpi, @QueryParam("connectionTimeout") String connectionTimeout); + Response testLDAPConnection(@FormParam("action") String action, @FormParam("connectionUrl") String connectionUrl, + @FormParam("bindDn") String bindDn, @FormParam("bindCredential") String bindCredential, + @FormParam("useTruststoreSpi") String useTruststoreSpi, @FormParam("connectionTimeout") String connectionTimeout); @Path("testSMTPConnection/{config}") @POST 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 3a82baa590..41efff87cf 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 @@ -83,6 +83,7 @@ import org.keycloak.storage.UserStorageProviderModel; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; +import javax.ws.rs.FormParam; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; @@ -820,12 +821,12 @@ public class RealmAdminResource { * @return */ @Path("testLDAPConnection") - @GET + @POST @NoCache - public Response testLDAPConnection(@QueryParam("action") String action, @QueryParam("connectionUrl") String connectionUrl, - @QueryParam("bindDn") String bindDn, @QueryParam("bindCredential") String bindCredential, - @QueryParam("useTruststoreSpi") String useTruststoreSpi, @QueryParam("connectionTimeout") String connectionTimeout, - @QueryParam("componentId") String componentId) { + public Response testLDAPConnection(@FormParam("action") String action, @FormParam("connectionUrl") String connectionUrl, + @FormParam("bindDn") String bindDn, @FormParam("bindCredential") String bindCredential, + @FormParam("useTruststoreSpi") String useTruststoreSpi, @FormParam("connectionTimeout") String connectionTimeout, + @FormParam("componentId") String componentId) { auth.realm().requireManageRealm(); if (componentId != null && bindCredential.equals(ComponentRepresentation.SECRET_VALUE)) { diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js index f1c07425bc..82c9a776a9 100755 --- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js +++ b/themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js @@ -1322,7 +1322,7 @@ module.controller('LDAPUserStorageCtrl', function($scope, $location, Notificatio $scope.testConnection = function() { console.log('LDAPCtrl: testConnection'); - RealmLDAPConnectionTester.get(initConnectionTest("testConnection", $scope.instance.config), function() { + RealmLDAPConnectionTester.post(initConnectionTest("testConnection", $scope.instance.config), function() { Notifications.success("LDAP connection successful."); }, function() { Notifications.error("Error when trying to connect to LDAP. See server.log for details."); @@ -1331,7 +1331,7 @@ module.controller('LDAPUserStorageCtrl', function($scope, $location, Notificatio $scope.testAuthentication = function() { console.log('LDAPCtrl: testAuthentication'); - RealmLDAPConnectionTester.get(initConnectionTest("testAuthentication", $scope.instance.config), function() { + RealmLDAPConnectionTester.post(initConnectionTest("testAuthentication", $scope.instance.config), function() { Notifications.success("LDAP authentication successful."); }, function() { Notifications.error("LDAP authentication failed. See server.log for details");