From e6745532ce8978d69ef742916381002933dd88e7 Mon Sep 17 00:00:00 2001 From: William DeCoste Date: Wed, 2 Sep 2015 09:05:54 -0700 Subject: [PATCH 01/35] KEYCLOAK-1779 --- .../subsystem/as7/KeycloakAdapterConfigDeploymentProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigDeploymentProcessor.java b/integration/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigDeploymentProcessor.java index 08dbdd7422..6cd1856ffe 100755 --- a/integration/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigDeploymentProcessor.java +++ b/integration/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigDeploymentProcessor.java @@ -67,7 +67,7 @@ public class KeycloakAdapterConfigDeploymentProcessor implements DeploymentUnitP // if secure-deployment configuration exists for web app, we force KEYCLOAK auth method on it // otherwise we only set up KEYCLOAK auth if it's requested through web.xml auth-method LoginConfigMetaData loginConfig = webMetaData.getLoginConfig(); - if (!service.isSecureDeployment(deploymentName) && (loginConfig == null || !loginConfig.getAuthMethod().equalsIgnoreCase("KEYCLOAK"))) { + if (!service.isSecureDeployment(deploymentName) || loginConfig == null || !loginConfig.getAuthMethod().equalsIgnoreCase("KEYCLOAK")) { return; } From b0095154d14710833d6b83921a850b8a7bfbbf7f Mon Sep 17 00:00:00 2001 From: Marko Strukelj Date: Fri, 4 Sep 2015 14:11:54 +0200 Subject: [PATCH 02/35] KEYCLOAK-1779 NPE due to missing web.xml/jboss-web.xml - improved code readability and npe fix --- ...cloakAdapterConfigDeploymentProcessor.java | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/integration/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigDeploymentProcessor.java b/integration/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigDeploymentProcessor.java index 6cd1856ffe..5891b4b802 100755 --- a/integration/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigDeploymentProcessor.java +++ b/integration/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigDeploymentProcessor.java @@ -64,23 +64,28 @@ public class KeycloakAdapterConfigDeploymentProcessor implements DeploymentUnitP KeycloakAdapterConfigService service = KeycloakAdapterConfigService.getInstance(); - // if secure-deployment configuration exists for web app, we force KEYCLOAK auth method on it - // otherwise we only set up KEYCLOAK auth if it's requested through web.xml auth-method + // otherwise LoginConfigMetaData loginConfig = webMetaData.getLoginConfig(); - if (!service.isSecureDeployment(deploymentName) || loginConfig == null || !loginConfig.getAuthMethod().equalsIgnoreCase("KEYCLOAK")) { - return; + + boolean hasSubsystemConfig = service.isSecureDeployment(deploymentName); + boolean webRequiresKC = loginConfig != null && "KEYCLOAK".equalsIgnoreCase(loginConfig.getAuthMethod()); + + if (hasSubsystemConfig || webRequiresKC) { + log.debug("Setting up KEYCLOAK auth method for WAR: " + deploymentName); + + // if secure-deployment configuration exists for web app, we force KEYCLOAK auth method on it + if (hasSubsystemConfig) { + addJSONData(service.getJSON(deploymentName), warMetaData); + if (loginConfig != null) { + loginConfig.setAuthMethod("KEYCLOAK"); + loginConfig.setRealmName(service.getRealmName(deploymentName)); + } else { + log.warn("Failed to set up KEYCLOAK auth method for WAR: " + deploymentName + " (loginConfig == null)"); + } + } + addValve(webMetaData); + KeycloakLogger.ROOT_LOGGER.deploymentSecured(deploymentName); } - - log.debug("Setting up KEYCLOAK auth method for WAR: " + deploymentName); - loginConfig.setAuthMethod("KEYCLOAK"); - - if (service.isSecureDeployment(deploymentName)) { - addJSONData(service.getJSON(deploymentName), warMetaData); - loginConfig.setRealmName(service.getRealmName(deploymentName)); - } - addValve(webMetaData); - - KeycloakLogger.ROOT_LOGGER.deploymentSecured(deploymentName); } private void addValve(JBossWebMetaData webMetaData) { From 35e63a9398f27a96146dba964b8ac9de9007bc5f Mon Sep 17 00:00:00 2001 From: mposolda Date: Fri, 4 Sep 2015 15:19:32 +0200 Subject: [PATCH 03/35] KEYCLOAK-1801 Additional fix and cleanup --- .../theme/base/admin/resources/js/app.js | 3 + .../admin/resources/js/controllers/clients.js | 69 ++++++++----------- .../theme/base/admin/resources/js/loaders.js | 5 +- .../theme/base/admin/resources/js/services.js | 5 +- .../partials/client-credentials-generic.html | 22 +++--- .../ClientAuthenticatorFactory.java | 7 -- .../ClientIdAndSecretAuthenticator.java | 5 -- .../client/JWTClientAuthenticator.java | 5 -- .../AuthenticationManagementResource.java | 34 +++++---- .../forms/PassThroughClientAuthenticator.java | 5 -- 10 files changed, 65 insertions(+), 95 deletions(-) diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js index 7819f8b2cf..903131d0d1 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js @@ -638,6 +638,9 @@ module.config([ '$routeProvider', function($routeProvider) { }, clientAuthenticatorProviders : function(ClientAuthenticatorProvidersLoader) { return ClientAuthenticatorProvidersLoader(); + }, + clientConfigProperties: function(PerClientAuthenticationConfigDescriptionLoader) { + return PerClientAuthenticationConfigDescriptionLoader(); } }, controller : 'ClientCredentialsCtrl' diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js index 46f6c9a494..ae334e73c6 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js @@ -30,39 +30,12 @@ module.controller('ClientRoleListCtrl', function($scope, $location, realm, clien }); }); -module.controller('ClientCredentialsCtrl', function($scope, $location, realm, client, clientAuthenticatorProviders, Client) { +module.controller('ClientCredentialsCtrl', function($scope, $location, realm, client, clientAuthenticatorProviders, clientConfigProperties, Client) { $scope.realm = realm; $scope.client = angular.copy(client); $scope.clientAuthenticatorProviders = clientAuthenticatorProviders; - var updateConfigButtonVisibility = function() { - for (var i=0 ; i -
- -
+
+
+
+ +
-
-
- - +
+
+ + +
-
- \ No newline at end of file + +
\ No newline at end of file diff --git a/services/src/main/java/org/keycloak/authentication/ClientAuthenticatorFactory.java b/services/src/main/java/org/keycloak/authentication/ClientAuthenticatorFactory.java index 338f9801b2..08321ea922 100644 --- a/services/src/main/java/org/keycloak/authentication/ClientAuthenticatorFactory.java +++ b/services/src/main/java/org/keycloak/authentication/ClientAuthenticatorFactory.java @@ -25,13 +25,6 @@ public interface ClientAuthenticatorFactory extends ProviderFactory getPerClientConfigDescription(@PathParam("providerId") String providerId) { + public Map> getPerClientConfigDescription() { this.auth.requireView(); - ConfigurableAuthenticatorFactory factory = CredentialHelper.getConfigurableAuthenticatorFactory(session, providerId); - ClientAuthenticatorFactory clientAuthFactory = (ClientAuthenticatorFactory) factory; - List perClientConfigProps = clientAuthFactory.getConfigPropertiesPerClient(); - List result = new LinkedList<>(); - for (ProviderConfigProperty prop : perClientConfigProps) { - ConfigPropertyRepresentation propRep = getConfigPropertyRep(prop); - result.add(propRep); + List factories = session.getKeycloakSessionFactory().getProviderFactories(ClientAuthenticator.class); + + Map> toReturn = new HashMap<>(); + for (ProviderFactory clientAuthenticatorFactory : factories) { + String providerId = clientAuthenticatorFactory.getId(); + ConfigurableAuthenticatorFactory factory = CredentialHelper.getConfigurableAuthenticatorFactory(session, providerId); + ClientAuthenticatorFactory clientAuthFactory = (ClientAuthenticatorFactory) factory; + List perClientConfigProps = clientAuthFactory.getConfigPropertiesPerClient(); + List result = new LinkedList<>(); + for (ProviderConfigProperty prop : perClientConfigProps) { + ConfigPropertyRepresentation propRep = getConfigPropertyRep(prop); + result.add(propRep); + } + + toReturn.put(providerId, result); } - return result; + + return toReturn; } @Path("config") diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/PassThroughClientAuthenticator.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/PassThroughClientAuthenticator.java index 0c35b7569c..f45792055e 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/PassThroughClientAuthenticator.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/PassThroughClientAuthenticator.java @@ -68,11 +68,6 @@ public class PassThroughClientAuthenticator extends AbstractClientAuthenticator return false; } - @Override - public boolean isConfigurablePerClient() { - return true; - } - @Override public AuthenticationExecutionModel.Requirement[] getRequirementChoices() { return REQUIREMENT_CHOICES; From f3675681c3d4422f2ad2c69d59695102eca1a7b8 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Fri, 4 Sep 2015 16:55:32 +0200 Subject: [PATCH 04/35] KEYCLOAK-1804 Replace -snapshot with startup time in resource urls --- core/src/main/java/org/keycloak/Version.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/org/keycloak/Version.java b/core/src/main/java/org/keycloak/Version.java index 88168437ef..2ba5b9b458 100755 --- a/core/src/main/java/org/keycloak/Version.java +++ b/core/src/main/java/org/keycloak/Version.java @@ -1,6 +1,7 @@ package org.keycloak; import org.codehaus.jackson.annotate.JsonProperty; +import org.keycloak.util.Time; import java.io.IOException; import java.io.InputStream; @@ -28,6 +29,9 @@ public class Version { VERSION = props.getProperty("version"); BUILD_TIME = props.getProperty("build-time"); RESOURCES_VERSION = VERSION.toLowerCase(); + if (RESOURCES_VERSION.endsWith("-snapshot")) { + RESOURCES_VERSION = RESOURCES_VERSION.replace("-snapshot", "-" + Time.currentTime()); + } } catch (IOException e) { VERSION=UNKNOWN; BUILD_TIME=UNKNOWN; From 81f4c50574173ba5161e2b782dd9d24b73cb64a0 Mon Sep 17 00:00:00 2001 From: mposolda Date: Fri, 4 Sep 2015 22:22:56 +0200 Subject: [PATCH 05/35] KEYCLOAK-1799 Download adapter JSON config with proper adapter --- .../ClientAuthenticatorFactory.java | 10 ++++++++++ .../client/ClientIdAndSecretAuthenticator.java | 10 ++++++++++ .../client/JWTClientAuthenticator.java | 17 +++++++++++++++++ .../services/managers/ClientManager.java | 16 +++++++++------- .../forms/PassThroughClientAuthenticator.java | 13 +++++++++++++ 5 files changed, 59 insertions(+), 7 deletions(-) diff --git a/services/src/main/java/org/keycloak/authentication/ClientAuthenticatorFactory.java b/services/src/main/java/org/keycloak/authentication/ClientAuthenticatorFactory.java index 08321ea922..4b4c100f2e 100644 --- a/services/src/main/java/org/keycloak/authentication/ClientAuthenticatorFactory.java +++ b/services/src/main/java/org/keycloak/authentication/ClientAuthenticatorFactory.java @@ -1,7 +1,9 @@ package org.keycloak.authentication; import java.util.List; +import java.util.Map; +import org.keycloak.models.ClientModel; import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.provider.ProviderFactory; @@ -33,4 +35,12 @@ public interface ClientAuthenticatorFactory extends ProviderFactory getConfigPropertiesPerClient(); + /** + * Get configuration, which needs to be used for adapter ( keycloak.json ) of particular client. Some implementations + * may return just template and user needs to edit the values according to his environment (For example fill the location of keystore file) + * + * @return + */ + Map getAdapterConfiguration(ClientModel client); + } diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientIdAndSecretAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientIdAndSecretAuthenticator.java index a30ecbd313..e86e68e10e 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientIdAndSecretAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientIdAndSecretAuthenticator.java @@ -1,8 +1,10 @@ package org.keycloak.authentication.authenticators.client; import java.util.Collections; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; +import java.util.Map; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MultivaluedMap; @@ -20,6 +22,7 @@ import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.provider.ProviderConfigProperty; +import org.keycloak.representations.idm.CredentialRepresentation; import org.keycloak.util.BasicAuthHelper; /** @@ -148,6 +151,13 @@ public class ClientIdAndSecretAuthenticator extends AbstractClientAuthenticator return Collections.emptyList(); } + @Override + public Map getAdapterConfiguration(ClientModel client) { + Map result = new HashMap<>(); + result.put(CredentialRepresentation.SECRET, client.getSecret()); + return result; + } + @Override public String getId() { return PROVIDER_ID; diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/client/JWTClientAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/client/JWTClientAuthenticator.java index 4bb2f4f624..bb87e34dc0 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/client/JWTClientAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/client/JWTClientAuthenticator.java @@ -3,8 +3,10 @@ package org.keycloak.authentication.authenticators.client; import java.security.PublicKey; import java.security.cert.X509Certificate; import java.util.Collections; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; +import java.util.Map; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; @@ -165,6 +167,21 @@ public class JWTClientAuthenticator extends AbstractClientAuthenticator { return Collections.emptyList(); } + @Override + public Map getAdapterConfiguration(ClientModel client) { + Map props = new HashMap<>(); + props.put("client-keystore-file", "REPLACE WITH THE LOCATION OF YOUR KEYSTORE FILE"); + props.put("client-keystore-type", "jks"); + props.put("client-keystore-password", "REPLACE WITH THE KEYSTORE PASSWORD"); + props.put("client-key-password", "REPLACE WITH THE KEY PASSWORD IN KEYSTORE"); + props.put("client-key-alias", client.getClientId()); + props.put("token-timeout", 10); + + Map config = new HashMap<>(); + config.put("jwt", props); + return config; + } + @Override public String getId() { return PROVIDER_ID; diff --git a/services/src/main/java/org/keycloak/services/managers/ClientManager.java b/services/src/main/java/org/keycloak/services/managers/ClientManager.java index 1b5a4e88b0..fbf530b36f 100755 --- a/services/src/main/java/org/keycloak/services/managers/ClientManager.java +++ b/services/src/main/java/org/keycloak/services/managers/ClientManager.java @@ -3,6 +3,8 @@ package org.keycloak.services.managers; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.annotate.JsonPropertyOrder; import org.jboss.logging.Logger; +import org.keycloak.authentication.ClientAuthenticator; +import org.keycloak.authentication.ClientAuthenticatorFactory; import org.keycloak.constants.ServiceAccountConstants; import org.keycloak.models.ClientModel; import org.keycloak.models.ProtocolMapperModel; @@ -156,7 +158,7 @@ public class ClientManager { @JsonProperty("public-client") protected Boolean publicClient; @JsonProperty("credentials") - protected Map credentials; + protected Map credentials; public Boolean isUseResourceRoleMappings() { return useResourceRoleMappings; @@ -174,11 +176,11 @@ public class ClientManager { this.resource = resource; } - public Map getCredentials() { + public Map getCredentials() { return credentials; } - public void setCredentials(Map credentials) { + public void setCredentials(Map credentials) { this.credentials = credentials; } @@ -214,10 +216,10 @@ public class ClientManager { rep.setResource(clientModel.getClientId()); if (!clientModel.isBearerOnly() && !clientModel.isPublicClient()) { - Map creds = new HashMap(); - String cred = clientModel.getSecret(); - creds.put(CredentialRepresentation.SECRET, cred); - rep.setCredentials(creds); + String clientAuthenticator = clientModel.getClientAuthenticatorType(); + ClientAuthenticatorFactory authenticator = (ClientAuthenticatorFactory) realmManager.getSession().getKeycloakSessionFactory().getProviderFactory(ClientAuthenticator.class, clientAuthenticator); + Map adapterConfig = authenticator.getAdapterConfiguration(clientModel); + rep.setCredentials(adapterConfig); } return rep; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/PassThroughClientAuthenticator.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/PassThroughClientAuthenticator.java index f45792055e..1e2b50a451 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/PassThroughClientAuthenticator.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/PassThroughClientAuthenticator.java @@ -1,8 +1,10 @@ package org.keycloak.testsuite.forms; import java.util.ArrayList; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; +import java.util.Map; import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.ClientAuthenticationFlowContext; @@ -88,6 +90,17 @@ public class PassThroughClientAuthenticator extends AbstractClientAuthenticator return clientConfigProperties; } + @Override + public Map getAdapterConfiguration(ClientModel client) { + Map props = new HashMap<>(); + props.put("foo", "some foo value"); + props.put("bar", true); + + Map config = new HashMap<>(); + config.put("dummy", props); + return config; + } + @Override public String getId() { return PROVIDER_ID; From f6ec9af61ef4b6384fea6aa02a5e19bea8c40a7b Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Mon, 7 Sep 2015 09:33:34 +0200 Subject: [PATCH 06/35] KEYCLOAK-1805 address theme causes exception for login theme --- .../main/resources/theme/address/login/login-update-profile.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/themes/src/main/resources/theme/address/login/login-update-profile.ftl b/examples/themes/src/main/resources/theme/address/login/login-update-profile.ftl index 8be620d18f..e02a340405 100755 --- a/examples/themes/src/main/resources/theme/address/login/login-update-profile.ftl +++ b/examples/themes/src/main/resources/theme/address/login/login-update-profile.ftl @@ -5,7 +5,7 @@ <#elseif section = "header"> ${msg("loginProfileTitle")} <#elseif section = "form"> -
+
From dca1751a63eb2b0b266b8c818771f17fc2bd96b5 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Mon, 7 Sep 2015 09:40:34 +0200 Subject: [PATCH 07/35] KEYCLOAK-1812 View user attributes in admin console doesn't work --- .../theme/base/admin/resources/partials/user-attributes.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/user-attributes.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/user-attributes.html index 542431dcf6..9713a80639 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/user-attributes.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/user-attributes.html @@ -16,7 +16,7 @@ - + {{key}} From 5a3938d12f203ca11a8244db9514159c522d6a64 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Mon, 7 Sep 2015 09:59:32 +0200 Subject: [PATCH 08/35] KEYCLOAK-1806 oauth-client example fails if you say no to grant --- .../third-party/src/main/webapp/WEB-INF/web.xml | 6 ++++++ .../demo-template/third-party/src/main/webapp/error.jsp | 1 + 2 files changed, 7 insertions(+) create mode 100644 examples/demo-template/third-party/src/main/webapp/error.jsp diff --git a/examples/demo-template/third-party/src/main/webapp/WEB-INF/web.xml b/examples/demo-template/third-party/src/main/webapp/WEB-INF/web.xml index 958839db9f..9e72e01e90 100755 --- a/examples/demo-template/third-party/src/main/webapp/WEB-INF/web.xml +++ b/examples/demo-template/third-party/src/main/webapp/WEB-INF/web.xml @@ -9,6 +9,12 @@ org.keycloak.example.oauth.Bootstrap + + + java.lang.RuntimeException + /error.jsp + + + ${project.basedir}/target/apidocs-rest/asciidoc + + + + + + + + + diff --git a/services/src/docs/asciidoc/index.adoc b/services/src/docs/asciidoc/index.adoc new file mode 100644 index 0000000000..226d206aca --- /dev/null +++ b/services/src/docs/asciidoc/index.adoc @@ -0,0 +1,3 @@ +include::{generated}/overview.adoc[] +include::{generated}/paths.adoc[] +include::{generated}/definitions.adoc[] \ No newline at end of file diff --git a/services/src/docs/swagger/apiinfo.json b/services/src/docs/swagger/apiinfo.json new file mode 100644 index 0000000000..575955f57d --- /dev/null +++ b/services/src/docs/swagger/apiinfo.json @@ -0,0 +1,4 @@ +{ + "title": "Keycloak Admin REST API", + "description": "This is a REST API reference for the Keycloak Admin" +} \ No newline at end of file diff --git a/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java b/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java index d57e96ee32..834d957324 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/AdminRoot.java @@ -77,6 +77,7 @@ public class AdminRoot { /** * Convenience path to master realm admin console * + * @exclude * @return */ @GET @@ -90,6 +91,7 @@ public class AdminRoot { /** * Convenience path to master realm admin console * + * @exclude * @return */ @Path("index.{html:html}") // expression is actually "index.html" but this is a hack to get around jax-doclet bug @@ -118,6 +120,7 @@ public class AdminRoot { /** * path to realm admin console ui * + * @exclude * @param name Realm name (not id!) * @return */ From 3bbe82057c4d55c452724a4e99bf3d092bd2d99d Mon Sep 17 00:00:00 2001 From: Marko Strukelj Date: Tue, 15 Sep 2015 21:22:06 +0200 Subject: [PATCH 29/35] KEYCLOAK-1241 Can't build release with Java 8 - Improve javadoc comments for new REST API documentation generation --- services/pom.xml | 1 + .../ClientIdAndSecretAuthenticator.java | 7 +- .../client/JWTClientAuthenticator.java | 3 +- .../services/managers/RealmManager.java | 2 +- .../admin/AttackDetectionResource.java | 48 +---- .../AuthenticationManagementResource.java | 171 ++++++++++++++++-- .../ClientAttributeCertificateResource.java | 13 +- .../resources/admin/ClientResource.java | 62 +++++-- .../resources/admin/ClientsResource.java | 8 +- .../admin/IdentityProviderResource.java | 54 +++++- .../admin/IdentityProvidersResource.java | 34 ++++ .../admin/ProtocolMappersResource.java | 31 +++- .../resources/admin/RealmAdminResource.java | 62 ++++--- .../resources/admin/RealmsAdminResource.java | 14 +- .../resources/admin/RoleByIdResource.java | 22 ++- .../admin/RoleContainerResource.java | 15 +- .../admin/ScopeMappedClientResource.java | 12 +- .../resources/admin/ScopeMappedResource.java | 12 +- .../admin/UserClientRoleMappingsResource.java | 14 +- .../admin/UserFederationProviderResource.java | 20 +- .../UserFederationProvidersResource.java | 10 +- .../resources/admin/UsersResource.java | 125 ++++++++----- .../admin/info/ServerInfoAdminResource.java | 2 +- 23 files changed, 528 insertions(+), 214 deletions(-) diff --git a/services/pom.xml b/services/pom.xml index 25e1756547..bfb07ce768 100755 --- a/services/pom.xml +++ b/services/pom.xml @@ -292,6 +292,7 @@ + ${project.basedir}/target/apidocs-rest/asciidoc diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientIdAndSecretAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientIdAndSecretAuthenticator.java index e86e68e10e..bb17291d85 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientIdAndSecretAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientIdAndSecretAuthenticator.java @@ -12,15 +12,10 @@ import javax.ws.rs.core.Response; import org.jboss.logging.Logger; import org.keycloak.OAuth2Constants; -import org.keycloak.authentication.AuthenticationFlowContext; import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.ClientAuthenticationFlowContext; -import org.keycloak.events.Details; -import org.keycloak.events.Errors; import org.keycloak.models.AuthenticationExecutionModel; import org.keycloak.models.ClientModel; -import org.keycloak.models.KeycloakSession; -import org.keycloak.models.RealmModel; import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.representations.idm.CredentialRepresentation; import org.keycloak.util.BasicAuthHelper; @@ -147,7 +142,7 @@ public class ClientIdAndSecretAuthenticator extends AbstractClientAuthenticator @Override public List getConfigPropertiesPerClient() { - // This impl doesn't use generic screen in admin console, but has it's own screen. So no need to return anything here + // This impl doesn't use generic screen in admin console, but has its own screen. So no need to return anything here return Collections.emptyList(); } diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/client/JWTClientAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/client/JWTClientAuthenticator.java index bb87e34dc0..0c308abec3 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/client/JWTClientAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/client/JWTClientAuthenticator.java @@ -19,7 +19,6 @@ import org.keycloak.jose.jws.JWSInput; import org.keycloak.jose.jws.crypto.RSAProvider; import org.keycloak.models.AuthenticationExecutionModel; import org.keycloak.models.ClientModel; -import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.provider.ProviderConfigProperty; @@ -163,7 +162,7 @@ public class JWTClientAuthenticator extends AbstractClientAuthenticator { @Override public List getConfigPropertiesPerClient() { - // This impl doesn't use generic screen in admin console, but has it's own screen. So no need to return anything here + // This impl doesn't use generic screen in admin console, but has its own screen. So no need to return anything here return Collections.emptyList(); } diff --git a/services/src/main/java/org/keycloak/services/managers/RealmManager.java b/services/src/main/java/org/keycloak/services/managers/RealmManager.java index bb582af189..fb0578e8f3 100755 --- a/services/src/main/java/org/keycloak/services/managers/RealmManager.java +++ b/services/src/main/java/org/keycloak/services/managers/RealmManager.java @@ -337,7 +337,7 @@ public class RealmManager implements RealmImporter { } // Could happen when migrating from older version and I have exported JSON file, which contains "realm-management" client but not "impersonation" client - // I need to postpone impersonation because it needs "realm-management" client and it's roles set + // I need to postpone impersonation because it needs "realm-management" client and its roles set if (postponeImpersonationSetup) { setupImpersonationService(realm); } diff --git a/services/src/main/java/org/keycloak/services/resources/admin/AttackDetectionResource.java b/services/src/main/java/org/keycloak/services/resources/admin/AttackDetectionResource.java index 38eec9cd77..26b9956f56 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/AttackDetectionResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/AttackDetectionResource.java @@ -2,64 +2,24 @@ package org.keycloak.services.resources.admin; import org.jboss.logging.Logger; import org.jboss.resteasy.annotations.cache.NoCache; -import org.jboss.resteasy.spi.BadRequestException; -import org.jboss.resteasy.spi.NotFoundException; -import org.jboss.resteasy.spi.ResteasyProviderFactory; import org.keycloak.ClientConnection; -import org.keycloak.events.Event; -import org.keycloak.events.EventQuery; -import org.keycloak.events.EventStoreProvider; -import org.keycloak.events.EventType; -import org.keycloak.events.admin.AdminEvent; -import org.keycloak.events.admin.AdminEventQuery; import org.keycloak.events.admin.OperationType; -import org.keycloak.exportimport.ClientImporter; -import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; -import org.keycloak.models.ModelDuplicateException; import org.keycloak.models.RealmModel; -import org.keycloak.models.UserFederationProviderModel; -import org.keycloak.models.UserSessionModel; import org.keycloak.models.UsernameLoginFailureModel; -import org.keycloak.models.cache.CacheRealmProvider; -import org.keycloak.models.cache.CacheUserProvider; -import org.keycloak.models.utils.ModelToRepresentation; -import org.keycloak.models.utils.RepresentationToModel; -import org.keycloak.protocol.oidc.TokenManager; -import org.keycloak.representations.adapters.action.GlobalRequestResult; -import org.keycloak.representations.idm.RealmEventsConfigRepresentation; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.services.ErrorResponse; -import org.keycloak.services.managers.AuthenticationManager; import org.keycloak.services.managers.BruteForceProtector; -import org.keycloak.services.managers.LDAPConnectionTestManager; -import org.keycloak.services.managers.RealmManager; -import org.keycloak.services.managers.ResourceAdminManager; -import org.keycloak.services.managers.UsersSyncManager; -import org.keycloak.timer.TimerProvider; -import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; import java.util.Map; -import java.util.regex.PatternSyntaxException; /** * Base resource class for the admin REST api of one realm @@ -127,7 +87,9 @@ public class AttackDetectionResource { } /** - * Clear any user login failures for the user. This can release temporary disabled user + * Clear any user login failures for the user + * + * This can release temporary disabled user * * @param username */ @@ -143,7 +105,9 @@ public class AttackDetectionResource { } /** - * Clear any user login failures for all users. This can release temporary disabled users + * Clear any user login failures for all users + * + * This can release temporary disabled users * */ @Path("brute-force/usernames") diff --git a/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java b/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java index 0bb2e11866..ede2e278a7 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java @@ -6,13 +6,10 @@ import org.jboss.resteasy.spi.BadRequestException; import org.jboss.resteasy.spi.NotFoundException; import org.keycloak.authentication.AuthenticationFlow; import org.keycloak.authentication.Authenticator; -import org.keycloak.authentication.AuthenticatorUtil; import org.keycloak.authentication.ClientAuthenticator; import org.keycloak.authentication.ClientAuthenticatorFactory; import org.keycloak.authentication.ConfigurableAuthenticatorFactory; -import org.keycloak.authentication.DefaultAuthenticationFlow; import org.keycloak.authentication.FormAction; -import org.keycloak.authentication.FormAuthenticationFlow; import org.keycloak.authentication.FormAuthenticator; import org.keycloak.authentication.RequiredActionFactory; import org.keycloak.authentication.RequiredActionProvider; @@ -22,7 +19,6 @@ import org.keycloak.models.AuthenticatorConfigModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.RequiredActionProviderModel; -import org.keycloak.provider.ConfiguredProvider; import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.provider.ProviderFactory; import org.keycloak.representations.idm.ConfigPropertyRepresentation; @@ -172,6 +168,11 @@ public class AuthenticationManagementResource { } } + /** + * Get form providers + * + * Returns a list of form providers. + */ @Path("/form-providers") @GET @NoCache @@ -182,6 +183,11 @@ public class AuthenticationManagementResource { return buildProviderMetadata(factories); } + /** + * Get authenticator providers + * + * Returns a list of authenticator providers. + */ @Path("/authenticator-providers") @GET @NoCache @@ -192,6 +198,11 @@ public class AuthenticationManagementResource { return buildProviderMetadata(factories); } + /** + * Get client authenticator providers + * + * Returns a list of client authenticator providers. + */ @Path("/client-authenticator-providers") @GET @NoCache @@ -216,6 +227,11 @@ public class AuthenticationManagementResource { return providers; } + /** + * Get form action providers + * + * Returns a list of form action providers. + */ @Path("/form-action-providers") @GET @NoCache @@ -227,6 +243,11 @@ public class AuthenticationManagementResource { } + /** + * Get authentication flows + * + * Returns a list of authentication flows. + */ @Path("/flows") @GET @NoCache @@ -242,6 +263,12 @@ public class AuthenticationManagementResource { return flows; } + /** + * Create a new authentication flow + * + * @param model Authentication flow model + * @return + */ @Path("/flows") @POST @NoCache @@ -258,6 +285,12 @@ public class AuthenticationManagementResource { } + /** + * Get authentication flow for id + * + * @param id Flow id + * @return + */ @Path("/flows/{id}") @GET @NoCache @@ -272,6 +305,11 @@ public class AuthenticationManagementResource { return flow; } + /** + * Delete an authentication flow + * + * @param id Flow id + */ @Path("/flows/{id}") @DELETE @NoCache @@ -288,6 +326,14 @@ public class AuthenticationManagementResource { realm.removeAuthenticationFlow(flow); } + /** + * Copy existing authentication flow under a new name + * + * The new name is given as 'newName' attribute of the passed JSON object + * + * @param flowAlias Name of the existing authentication flow + * @param data JSON containing 'newName' attribute + */ @Path("/flows/{flowAlias}/copy") @POST @NoCache @@ -338,6 +384,12 @@ public class AuthenticationManagementResource { } } + /** + * Add new flow with new execution to existing flow + * + * @param flowAlias Alias of parent authentication flow + * @param data New authentication flow / execution JSON data containing 'alias', 'type', 'provider', and 'description' attributes + */ @Path("/flows/{flowAlias}/executions/flow") @POST @NoCache @@ -373,6 +425,12 @@ public class AuthenticationManagementResource { realm.addAuthenticatorExecution(execution); } + /** + * Add new authentication execution to a flow + * + * @param flowAlias Alias of parent flow + * @param data New execution JSON data containing 'provider' attribute + */ @Path("/flows/{flowAlias}/executions/execution") @POST @NoCache @@ -395,8 +453,11 @@ public class AuthenticationManagementResource { realm.addAuthenticatorExecution(execution); } - - + /** + * Get authentication executions for a flow + * + * @param flowAlias Flow alias + */ @Path("/flows/{flowAlias}/executions") @GET @NoCache @@ -467,6 +528,12 @@ public class AuthenticationManagementResource { } } + /** + * Update authentication executions of a flow + * + * @param flowAlias Flow alias + * @param rep + */ @Path("/flows/{flowAlias}/executions") @PUT @NoCache @@ -492,6 +559,11 @@ public class AuthenticationManagementResource { } } + /** + * Add new authentication execution + * + * @param model JSON model describing authentication execution + */ @Path("/executions") @POST @NoCache @@ -525,6 +597,11 @@ public class AuthenticationManagementResource { return parentFlow; } + /** + * Raise execution's priority + * + * @param execution Execution id + */ @Path("/executions/{executionId}/raise-priority") @POST @NoCache @@ -564,6 +641,11 @@ public class AuthenticationManagementResource { return executions; } + /** + * Lower execution's priority + * + * @param execution Execution id + */ @Path("/executions/{executionId}/lower-priority") @POST @NoCache @@ -597,6 +679,11 @@ public class AuthenticationManagementResource { } + /** + * Delete execution + * + * @param execution Execution id + */ @Path("/executions/{executionId}") @DELETE @NoCache @@ -617,9 +704,13 @@ public class AuthenticationManagementResource { } - - - + /** + * Update execution with new configuration + * + * @param execution Execution id + * @param config JSON with new configuration + * @return + */ @Path("/executions/{executionId}/config") @POST @NoCache @@ -639,6 +730,12 @@ public class AuthenticationManagementResource { return Response.created(uriInfo.getAbsolutePathBuilder().path(config.getId()).build()).build(); } + /** + * Get execution's configuration + * + * @param execution Execution id + * @param id Configuration id + */ @Path("/executions/{executionId}/config/{id}") @GET @Produces(MediaType.APPLICATION_JSON) @@ -702,6 +799,11 @@ public class AuthenticationManagementResource { } } + /** + * Get unregistered required actions + * + * Returns a list of unregistered required actions. + */ @Path("unregistered-required-actions") @GET @Produces(MediaType.APPLICATION_JSON) @@ -729,6 +831,11 @@ public class AuthenticationManagementResource { return unregisteredList; } + /** + * Register a new required actions + * + * @param data JSON containing 'providerId', and 'name' attributes. + */ @Path("register-required-action") @POST @Consumes(MediaType.APPLICATION_JSON) @@ -746,7 +853,11 @@ public class AuthenticationManagementResource { } - + /** + * Get required actions + * + * Returns a list of required actions. + */ @Path("required-actions") @GET @Produces(MediaType.APPLICATION_JSON) @@ -770,6 +881,10 @@ public class AuthenticationManagementResource { return rep; } + /** + * Get required action for alias + * @param alias Alias of required action + */ @Path("required-actions/{alias}") @GET @Produces(MediaType.APPLICATION_JSON) @@ -783,6 +898,12 @@ public class AuthenticationManagementResource { } + /** + * Update required action + * + * @param alias Alias of required action + * @param rep JSON describing new state of required action + */ @Path("required-actions/{alias}") @PUT @Consumes(MediaType.APPLICATION_JSON) @@ -803,6 +924,10 @@ public class AuthenticationManagementResource { realm.updateRequiredActionProvider(update); } + /** + * Delete required action + * @param alias Alias of required action + */ @Path("required-actions/{alias}") @DELETE public void updateRequiredAction(@PathParam("alias") String alias) { @@ -855,6 +980,9 @@ public class AuthenticationManagementResource { } + /** + * Get authenticator provider's configuration description + */ @Path("config-description/{providerId}") @GET @Produces(MediaType.APPLICATION_JSON) @@ -888,7 +1016,9 @@ public class AuthenticationManagementResource { return propRep; } - + /** + * Get configuration descriptions for all clients + */ @Path("per-client-config-description") @GET @Produces(MediaType.APPLICATION_JSON) @@ -915,6 +1045,10 @@ public class AuthenticationManagementResource { return toReturn; } + /** + * Create new authenticator configuration + * @param config JSON describing new authenticator configuration + */ @Path("config") @POST @NoCache @@ -924,6 +1058,10 @@ public class AuthenticationManagementResource { return Response.created(uriInfo.getAbsolutePathBuilder().path(config.getId()).build()).build(); } + /** + * Get authenticator configuration + * @param id Configuration id + */ @Path("config/{id}") @GET @Produces(MediaType.APPLICATION_JSON) @@ -937,6 +1075,11 @@ public class AuthenticationManagementResource { } return config; } + + /** + * Delete authenticator configuration + * @param id Configuration id + */ @Path("config/{id}") @DELETE @NoCache @@ -959,6 +1102,12 @@ public class AuthenticationManagementResource { realm.removeAuthenticatorConfig(config); } + + /** + * Update authenticator configuration + * @param id Configuration id + * @param config JSON describing new state of authenticator configuration + */ @Path("config/{id}") @PUT @Consumes(MediaType.APPLICATION_JSON) diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ClientAttributeCertificateResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ClientAttributeCertificateResource.java index f6949fc4c2..c6a5feae93 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ClientAttributeCertificateResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ClientAttributeCertificateResource.java @@ -64,6 +64,7 @@ public class ClientAttributeCertificateResource { } /** + * Get key info * * @return */ @@ -78,6 +79,7 @@ public class ClientAttributeCertificateResource { } /** + * Generate a new certificate with new key pair * * @return */ @@ -256,8 +258,9 @@ public class ClientAttributeCertificateResource { } /** + * Get a keystore file for the client, containing private key and public certificate * - * @param config + * @param config Keystore configuration as JSON * @return */ @POST @@ -288,10 +291,12 @@ public class ClientAttributeCertificateResource { } /** - * Generate new keypair and certificate and downloads private key into specified keystore format. Only generated certificate is saved in Keycloak DB, but private - * key is not. + * Generate a new keypair and certificate, and get the private key file * - * @param config + * Generates a keypair and certificate and serves the private key in a specified keystore format. + * Only generated public certificate is saved in Keycloak DB - the private key is not. + * + * @param config Keystore configuration as JSON * @return */ @POST diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java index 821f2793ee..2198333559 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java @@ -92,7 +92,7 @@ public class ClientResource { } /** - * Update the client. + * Update the client * @param rep * @return */ @@ -116,7 +116,7 @@ public class ClientResource { /** - * Get representation of the client. + * Get representation of the client * * @return */ @@ -129,6 +129,7 @@ public class ClientResource { } /** + * Get representation of certificate resource * * @param attributePrefix * @return @@ -140,7 +141,9 @@ public class ClientResource { /** - * Return keycloak.json file for this client to be used to configure the adapter of that client. + * Get keycloak.json file + * + * Returns a keycloak.json file to be used to configure the adapter of the specified client. * * @return * @throws IOException @@ -160,7 +163,9 @@ public class ClientResource { } /** - * Return XML that can be included in the JBoss/Wildfly Keycloak subsystem to configure the adapter of that client. + * Get adapter configuration XML for JBoss / Wildfly Keycloak subsystem + * + * Returns XML that can be included in the JBoss / Wildfly Keycloak subsystem to configure the adapter of that client. * * @return * @throws IOException @@ -177,7 +182,7 @@ public class ClientResource { } /** - * Delete this client. + * Delete the client * */ @DELETE @@ -190,7 +195,7 @@ public class ClientResource { /** - * Generates a new secret for this client + * Generate a new secret for the client * * @return */ @@ -209,7 +214,7 @@ public class ClientResource { } /** - * Get the secret of this client + * Get the client secret * * @return */ @@ -227,7 +232,7 @@ public class ClientResource { } /** - * Base path for managing the scope mappings for this client + * Base path for managing the scope mappings for the client * * @return */ @@ -242,7 +247,9 @@ public class ClientResource { } /** - * Returns set of allowed origin. This is used for CORS requests. Access tokens will have + * Get allowed origins + * + * This is used for CORS requests. Access tokens will have * their allowedOrigins claim set to this value for tokens created for this client. * * @return @@ -258,7 +265,9 @@ public class ClientResource { } /** - * Change the set of allowed origins. This is used for CORS requests. Access tokens will have + * Update allowed origins + * + * This is used for CORS requests. Access tokens will have * their allowedOrigins claim set to this value for tokens created for this client. * * @param allowedOrigins @@ -275,10 +284,12 @@ public class ClientResource { } /** - * Remove set of allowed origins from current allowed origins list. This is used for CORS requests. Access tokens will have + * Delete the specified origins from current allowed origins + * + * This is used for CORS requests. Access tokens will have * their allowedOrigins claim set to this value for tokens created for this client. * - * @param allowedOrigins + * @param allowedOrigins List of origins to delete */ @Path("allowed-origins") @DELETE @@ -294,7 +305,7 @@ public class ClientResource { } /** - * Returns user dedicated to this service account + * Get a user dedicated to the service account * * @return */ @@ -319,8 +330,9 @@ public class ClientResource { } /** - * If the client has an admin URL, push the client's revocation policy to it. + * Push the client's revocation policy to its admin URL * + * If the client has an admin URL, push revocation policy to it. */ @Path("push-revocation") @POST @@ -332,7 +344,9 @@ public class ClientResource { } /** - * Number of user sessions associated with this client + * Get application session count + * + * Returns a number of user sessions associated with this client * * { * "count": number @@ -352,8 +366,12 @@ public class ClientResource { } /** - * Return a list of user sessions associated with this client + * Get user sessions for client * + * Returns a list of user sessions associated with this client + * + * @param firstResult Paging offset + * @param maxResults Paging size * @return */ @Path("user-sessions") @@ -373,6 +391,8 @@ public class ClientResource { } /** + * Logout all sessions + * * If the client has an admin URL, invalidate all sessions associated with that client directly. * */ @@ -386,6 +406,8 @@ public class ClientResource { } /** + * Logout the user by username + * * If the client has an admin URL, invalidate the sessions for a particular user directly. * */ @@ -403,6 +425,8 @@ public class ClientResource { } /** + * Register a cluster node with the client + * * Manually register cluster node to this client - usually it's not needed to call this directly as adapter should handle * by sending registration request to Keycloak * @@ -423,7 +447,7 @@ public class ClientResource { } /** - * Unregister cluster node from this client + * Unregister a cluster node from the client * * @param node */ @@ -443,7 +467,9 @@ public class ClientResource { } /** - * Test if registered cluster nodes are available by sending 'ping' request to all of them + * Test if registered cluster nodes are available + * + * Tests availability by sending 'ping' request to all cluster nodes. * * @return */ diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ClientsResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ClientsResource.java index 862aa0952b..e780dbf9b1 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ClientsResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ClientsResource.java @@ -52,9 +52,9 @@ public class ClientsResource { } /** - * List of clients belonging to this realm. + * Get clients belonging to the realm * - * @return + * Returns a list of clients belonging to the realm */ @GET @Produces(MediaType.APPLICATION_JSON) @@ -80,7 +80,9 @@ public class ClientsResource { } /** - * Create a new client. Client client_id must be unique! + * Create a new client + * + * Client's client_id must be unique! * * @param uriInfo * @param rep diff --git a/services/src/main/java/org/keycloak/services/resources/admin/IdentityProviderResource.java b/services/src/main/java/org/keycloak/services/resources/admin/IdentityProviderResource.java index eeffe5dc22..bf17f4be0c 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/IdentityProviderResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/IdentityProviderResource.java @@ -7,7 +7,6 @@ import org.keycloak.broker.provider.IdentityProvider; import org.keycloak.broker.provider.IdentityProviderFactory; import org.keycloak.broker.provider.IdentityProviderMapper; import org.keycloak.events.admin.OperationType; -import org.keycloak.models.ClientModel; import org.keycloak.models.FederatedIdentityModel; import org.keycloak.models.IdentityProviderMapperModel; import org.keycloak.models.IdentityProviderModel; @@ -70,6 +69,11 @@ public class IdentityProviderResource { this.adminEvent = adminEvent; } + /** + * Get the identity provider + * + * @return + */ @GET @NoCache @Produces(MediaType.APPLICATION_JSON) @@ -79,6 +83,11 @@ public class IdentityProviderResource { return rep; } + /** + * Delete the identity provider + * + * @return + */ @DELETE @NoCache public Response delete() { @@ -91,6 +100,12 @@ public class IdentityProviderResource { return Response.noContent().build(); } + /** + * Update the identity provider + * + * @param providerRep + * @return + */ @PUT @Consumes(MediaType.APPLICATION_JSON) @NoCache @@ -161,7 +176,13 @@ public class IdentityProviderResource { return null; } - + /** + * Export public broker configuration for identity provider + * + * @param uriInfo + * @param format Format to use + * @return + */ @GET @Path("export") @NoCache @@ -175,6 +196,9 @@ public class IdentityProviderResource { } } + /** + * Get mapper types for identity provider + */ @GET @Path("mapper-types") @NoCache @@ -210,6 +234,9 @@ public class IdentityProviderResource { return types; } + /** + * Get mappers for identity provider + */ @GET @Path("mappers") @Produces(MediaType.APPLICATION_JSON) @@ -223,6 +250,12 @@ public class IdentityProviderResource { return mappers; } + /** + * Add a mapper to identity provider + * + * @param mapper + * @return + */ @POST @Path("mappers") @Consumes(MediaType.APPLICATION_JSON) @@ -238,6 +271,12 @@ public class IdentityProviderResource { } + /** + * Get mapper by id for the identity provider + * + * @param id + * @return + */ @GET @NoCache @Path("mappers/{id}") @@ -249,6 +288,12 @@ public class IdentityProviderResource { return ModelToRepresentation.toRepresentation(model); } + /** + * Update a mapper for the identity provider + * + * @param id Mapper id + * @param rep + */ @PUT @NoCache @Path("mappers/{id}") @@ -263,6 +308,11 @@ public class IdentityProviderResource { } + /** + * Delete a mapper for the identity provider + * + * @param id Mapper id + */ @DELETE @NoCache @Path("mappers/{id}") diff --git a/services/src/main/java/org/keycloak/services/resources/admin/IdentityProvidersResource.java b/services/src/main/java/org/keycloak/services/resources/admin/IdentityProvidersResource.java index 8b2a0499e5..d3dc33a5a2 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/IdentityProvidersResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/IdentityProvidersResource.java @@ -57,6 +57,12 @@ public class IdentityProvidersResource { this.adminEvent = adminEvent; } + /** + * Get identity providers + * + * @param providerId Provider id + * @return + */ @Path("/providers/{provider_id}") @GET @NoCache @@ -70,6 +76,14 @@ public class IdentityProvidersResource { return Response.status(BAD_REQUEST).build(); } + /** + * Import identity provider from uploaded JSON file + * + * @param uriInfo + * @param input + * @return + * @throws IOException + */ @POST @Path("import-config") @Consumes(MediaType.MULTIPART_FORM_DATA) @@ -85,6 +99,14 @@ public class IdentityProvidersResource { return config; } + /** + * Import identity provider from JSON body + * + * @param uriInfo + * @param data JSON body + * @return + * @throws IOException + */ @POST @Path("import-config") @Consumes(MediaType.APPLICATION_JSON) @@ -108,6 +130,11 @@ public class IdentityProvidersResource { } } + /** + * Get identity providers + * + * @return + */ @GET @Path("instances") @NoCache @@ -123,6 +150,13 @@ public class IdentityProvidersResource { return representations; } + /** + * Create a new identity provider + * + * @param uriInfo + * @param representation JSON body + * @return + */ @POST @Path("instances") @Consumes(MediaType.APPLICATION_JSON) diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ProtocolMappersResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ProtocolMappersResource.java index 145a26d0ce..306d350b65 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ProtocolMappersResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ProtocolMappersResource.java @@ -7,7 +7,6 @@ import org.keycloak.events.admin.OperationType; import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.ProtocolMapperModel; -import org.keycloak.models.RealmModel; import org.keycloak.models.utils.ModelToRepresentation; import org.keycloak.models.utils.RepresentationToModel; import org.keycloak.representations.idm.ProtocolMapperRepresentation; @@ -39,7 +38,7 @@ public class ProtocolMappersResource { protected ClientModel client; - protected RealmAuth auth; + protected RealmAuth auth; protected AdminEventBuilder adminEvent; @@ -58,7 +57,7 @@ public class ProtocolMappersResource { } /** - * Map of mappers by name for a specific protocol + * Get mappers by name for a specific protocol * * @param protocol * @return @@ -77,7 +76,7 @@ public class ProtocolMappersResource { } /** - * creates mapper + * Create a mapper * * @param rep */ @@ -93,7 +92,7 @@ public class ProtocolMappersResource { return Response.created(uriInfo.getAbsolutePathBuilder().path(model.getId()).build()).build(); } /** - * creates multiple mapper + * Create multiple mappers * */ @Path("add-models") @@ -110,6 +109,11 @@ public class ProtocolMappersResource { adminEvent.operation(OperationType.CREATE).resourcePath(uriInfo).representation(reps).success(); } + /** + * Get mappers + * + * @return + */ @GET @NoCache @Path("models") @@ -123,6 +127,12 @@ public class ProtocolMappersResource { return mappers; } + /** + * Get mapper by id + * + * @param id Mapper id + * @return + */ @GET @NoCache @Path("models/{id}") @@ -134,6 +144,12 @@ public class ProtocolMappersResource { return ModelToRepresentation.toRepresentation(model); } + /** + * Update the mapper + * + * @param id Mapper id + * @param rep + */ @PUT @NoCache @Path("models/{id}") @@ -147,6 +163,11 @@ public class ProtocolMappersResource { adminEvent.operation(OperationType.UPDATE).resourcePath(uriInfo).representation(rep).success(); } + /** + * Delete the mapper + * + * @param id Mapper id + */ @DELETE @NoCache @Path("models/{id}") 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 40710a1a11..bab74d646e 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java @@ -6,8 +6,6 @@ import org.jboss.resteasy.spi.BadRequestException; import org.jboss.resteasy.spi.NotFoundException; import org.jboss.resteasy.spi.ResteasyProviderFactory; import org.keycloak.ClientConnection; -import org.keycloak.authentication.RequiredActionFactory; -import org.keycloak.authentication.RequiredActionProvider; import org.keycloak.events.Event; import org.keycloak.events.EventQuery; import org.keycloak.events.EventStoreProvider; @@ -27,7 +25,6 @@ import org.keycloak.models.cache.CacheUserProvider; import org.keycloak.models.utils.ModelToRepresentation; import org.keycloak.models.utils.RepresentationToModel; import org.keycloak.protocol.oidc.TokenManager; -import org.keycloak.provider.ProviderFactory; import org.keycloak.representations.adapters.action.GlobalRequestResult; import org.keycloak.representations.idm.RealmEventsConfigRepresentation; import org.keycloak.representations.idm.RealmRepresentation; @@ -143,7 +140,9 @@ public class RealmAdminResource { } /** - * Get the top-level representation of the realm. It will not include nested information like User and Client representations. + * Get the top-level representation of the realm + * + * It will not include nested information like User and Client representations. * * @return */ @@ -172,7 +171,9 @@ public class RealmAdminResource { } /** - * Update the top-level information of this realm. Any user, roles or client information in the representation + * Update the top-level information of the realm + * + * Any user, roles or client information in the representation * will be ignored. This will only update top-level attributes of the realm. * * @param rep @@ -215,7 +216,7 @@ public class RealmAdminResource { } /** - * Delete this realm. + * Delete the realm * */ @DELETE @@ -260,7 +261,7 @@ public class RealmAdminResource { } /** - * Path for managing all realm-level or client-level roles defined in this realm by it's id. + * Path for managing all realm-level or client-level roles defined in this realm by its id. * * @return */ @@ -316,8 +317,10 @@ public class RealmAdminResource { } /** + * Get client session stats + * * Returns a JSON map. The key is the client id, the value is the number of sessions that currently are active - * with that client. Only client's that actually have a session associated with them will be in this map. + * with that client. Only clients that actually have a session associated with them will be in this map. * * @return */ @@ -341,7 +344,9 @@ public class RealmAdminResource { } /** - * View the events provider and how it is configured. + * Get the events provider configuration + * + * Returns JSON object with events provider configuration * * @return */ @@ -356,7 +361,9 @@ public class RealmAdminResource { } /** - * Change the events provider and/or it's configuration + * Update the events provider + * + * Change the events provider and/or its configuration * * @param rep */ @@ -371,15 +378,17 @@ public class RealmAdminResource { } /** - * Query events. Returns all events, or will query based on URL query parameters listed here + * Get events * - * @param client app or oauth client name - * @param user user id - * @param ipAddress - * @param dateTo - * @param dateFrom - * @param firstResult - * @param maxResults + * Returns all events, or filters them based on URL query parameters listed here + * + * @param client App or oauth client name + * @param user User id + * @param ipAddress IP address + * @param dateTo To date + * @param dateFrom From date + * @param firstResult Paging offset + * @param maxResults Paging size * @return */ @Path("events") @@ -448,7 +457,9 @@ public class RealmAdminResource { } /** - * Query admin events. Returns all admin events, or will query based on URL query parameters listed here + * Get admin events + * + * Returns all admin events, or filters events based on URL query parameters listed here * * @param authRealm * @param authClient @@ -538,7 +549,7 @@ public class RealmAdminResource { } /** - * Delete all events. + * Delete all events * */ @Path("events") @@ -551,7 +562,7 @@ public class RealmAdminResource { } /** - * Delete all admin events. + * Delete all admin events * */ @Path("admin-events") @@ -563,6 +574,15 @@ public class RealmAdminResource { eventStore.clearAdmin(realm.getId()); } + /** + * Test LDAP connection + * + * @param action + * @param connectionUrl + * @param bindDn + * @param bindCredential + * @return + */ @Path("testLDAPConnection") @GET @NoCache diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RealmsAdminResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RealmsAdminResource.java index f2494c90ee..d0fb5214eb 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/RealmsAdminResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/RealmsAdminResource.java @@ -73,7 +73,9 @@ public class RealmsAdminResource { } /** - * Returns a list of realms. This list is filtered based on what realms the caller is allowed to view. + * Get accessible realms + * + * Returns a list of accessible realms. The list is filtered based on what realms the caller is allowed to view. * * @return */ @@ -107,10 +109,12 @@ public class RealmsAdminResource { } /** - * Import a realm from a full representation of that realm. Realm name must be unique. + * Import a realm + * + * Imports a realm from a full representation of that realm. Realm name must be unique. * * @param uriInfo - * @param rep JSON representation + * @param rep JSON representation of the realm * @return */ @POST @@ -141,7 +145,9 @@ public class RealmsAdminResource { } /** - * Upload a realm from a uploaded JSON file. The posted represenation is expected to be a multipart/form-data encapsulation + * Import a realm from uploaded JSON file + * + * The posted represenation is expected to be a multipart/form-data encapsulation * of a JSON file. The same format a browser would use when uploading a file. * * @param uriInfo diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RoleByIdResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RoleByIdResource.java index bea5d5283c..1482cabe3f 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/RoleByIdResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/RoleByIdResource.java @@ -87,7 +87,7 @@ public class RoleByIdResource extends RoleResource { } /** - * Delete this role + * Delete the role * * @param id id of role */ @@ -102,7 +102,7 @@ public class RoleByIdResource extends RoleResource { } /** - * Update this role + * Update the role * * @param id id of role * @param rep @@ -118,7 +118,7 @@ public class RoleByIdResource extends RoleResource { } /** - * Make this role a composite role by associating some child roles to it. + * Make the role a composite role by associating some child roles * * @param id * @param roles @@ -133,7 +133,9 @@ public class RoleByIdResource extends RoleResource { } /** - * If this role is a composite, return a set of its children + * Get role's children + * + * Returns a set of role's children provided the role is a composite. * * @param id * @return @@ -151,7 +153,7 @@ public class RoleByIdResource extends RoleResource { } /** - * Return a set of realm-level roles that are in the role's composite + * Get realm-level roles that are in the role's composite * * @param id * @return @@ -167,7 +169,7 @@ public class RoleByIdResource extends RoleResource { } /** - * Return a set of client-level roles for a specific client that are in the role's composite + * Get client-level roles for the client that are in the role's composite * * @param id * @param client @@ -189,7 +191,7 @@ public class RoleByIdResource extends RoleResource { } /** - * Return a set of client-level roles for a specific client that are in the role's composite + * Get client-level roles for the client that are in the role's composite * * @param role * @param client @@ -212,10 +214,10 @@ public class RoleByIdResource extends RoleResource { } /** - * Remove the listed set of roles from this role's composite + * Remove a set of roles from the role's composite * - * @param id - * @param roles + * @param id Role id + * @param roles A set of roles to be removed */ @Path("{role-id}/composites") @DELETE diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RoleContainerResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RoleContainerResource.java index f267d15ef5..168ff471c6 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/RoleContainerResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/RoleContainerResource.java @@ -4,7 +4,6 @@ import org.jboss.resteasy.annotations.cache.NoCache; import org.jboss.resteasy.spi.NotFoundException; import org.keycloak.events.admin.OperationType; import org.keycloak.models.ClientModel; -import org.keycloak.models.KeycloakSession; import org.keycloak.models.ModelDuplicateException; import org.keycloak.models.RealmModel; import org.keycloak.models.RoleContainerModel; @@ -51,7 +50,7 @@ public class RoleContainerResource extends RoleResource { } /** - * List all roles for this realm or client + * Get all roles for the realm or client * * @return */ @@ -70,7 +69,7 @@ public class RoleContainerResource extends RoleResource { } /** - * Create a new role for this realm or client + * Create a new role for the realm or client * * @param rep * @return @@ -164,7 +163,7 @@ public class RoleContainerResource extends RoleResource { } /** - * Add a composite to this role + * Add a composite to the role * * @param roleName role's name (not id!) * @param roles @@ -183,7 +182,7 @@ public class RoleContainerResource extends RoleResource { } /** - * List composites of this role + * Get composites of the role * * @param roleName role's name (not id!) * @return @@ -203,7 +202,7 @@ public class RoleContainerResource extends RoleResource { } /** - * Get realm-level roles of this role's composite + * Get realm-level roles of the role's composite * * @param roleName role's name (not id!) * @return @@ -223,7 +222,7 @@ public class RoleContainerResource extends RoleResource { } /** - * An app-level roles for a specific app for this role's composite + * An app-level roles for the specified app for the role's composite * * @param roleName role's name (not id!) * @param client @@ -252,7 +251,7 @@ public class RoleContainerResource extends RoleResource { /** - * Remove roles from this role's composite + * Remove roles from the role's composite * * @param roleName role's name (not id!) * @param roles roles to remove diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedClientResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedClientResource.java index c087197efa..44b355e037 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedClientResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedClientResource.java @@ -44,7 +44,9 @@ public class ScopeMappedClientResource { } /** - * Get the roles associated with a client's scope for a specific client. + * Get the roles associated with a client's scope + * + * Returns roles for the client. * * @return */ @@ -63,7 +65,9 @@ public class ScopeMappedClientResource { } /** - * The available client-level roles that can be associated with the client's scope + * The available client-level roles + * + * Returns the roles for the client that can be associated with the client's scope * * @return */ @@ -79,7 +83,9 @@ public class ScopeMappedClientResource { } /** - * Get effective client roles that are associated with the client's scope for a specific client. + * Get effective client roles + * + * Returns the roles for the client that are associated with the client's scope. * * @return */ diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedResource.java index 407594452c..2d9b6a263b 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedResource.java @@ -19,9 +19,7 @@ import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.UriInfo; import java.util.ArrayList; import java.util.HashMap; @@ -51,7 +49,7 @@ public class ScopeMappedResource { } /** - * Get all scope mappings for this client + * Get all scope mappings for the client * * @return */ @@ -94,7 +92,7 @@ public class ScopeMappedResource { } /** - * Get list of realm-level roles associated with this client's scope. + * Get realm-level roles associated with the client's scope * * @return */ @@ -114,7 +112,7 @@ public class ScopeMappedResource { } /** - * Get list of realm-level roles that are available to attach to this client's scope. + * Get realm-level roles that are available to attach to this client's scope * * @return */ @@ -139,7 +137,9 @@ public class ScopeMappedResource { } /** - * Get all effective realm-level roles that are associated with this client's scope. What this does is recurse + * Get effective realm-level roles associated with the client's scope + * + * What this does is recurse * any composite roles associated with the client's scope and adds the roles to this lists. The method is really * to show a comprehensive total view of realm-level roles associated with the client. * diff --git a/services/src/main/java/org/keycloak/services/resources/admin/UserClientRoleMappingsResource.java b/services/src/main/java/org/keycloak/services/resources/admin/UserClientRoleMappingsResource.java index 228ebbde86..8c5851c99f 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/UserClientRoleMappingsResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/UserClientRoleMappingsResource.java @@ -5,7 +5,6 @@ import org.jboss.resteasy.annotations.cache.NoCache; import org.jboss.resteasy.spi.NotFoundException; import org.keycloak.events.admin.OperationType; import org.keycloak.models.ClientModel; -import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.RoleModel; import org.keycloak.models.UserModel; @@ -18,7 +17,6 @@ import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.UriInfo; @@ -51,7 +49,7 @@ public class UserClientRoleMappingsResource { } /** - * Get client-level role mappings for this user for a specific app + * Get client-level role mappings for the user, and the app * * @return */ @@ -70,7 +68,9 @@ public class UserClientRoleMappingsResource { } /** - * Get effective client-level role mappings. This recurses any composite roles + * Get effective client-level role mappings + * + * This recurses any composite roles * * @return */ @@ -120,9 +120,9 @@ public class UserClientRoleMappingsResource { } /** - * Add client-level roles to the user role mapping. + * Add client-level roles to the user role mapping * - * @param roles + * @param roles */ @POST @Consumes(MediaType.APPLICATION_JSON) @@ -141,7 +141,7 @@ public class UserClientRoleMappingsResource { } /** - * Delete client-level roles from user role mapping. + * Delete client-level roles from user role mapping * * @param roles */ diff --git a/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProviderResource.java b/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProviderResource.java index db1e278e92..6f7bedfd82 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProviderResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProviderResource.java @@ -98,7 +98,7 @@ public class UserFederationProviderResource { } /** - * get a provider + * Get a provider * */ @GET @@ -126,7 +126,7 @@ public class UserFederationProviderResource { } /** - * trigger sync of users + * Trigger sync of users * * @return */ @@ -150,7 +150,7 @@ public class UserFederationProviderResource { } /** - * List of available User Federation mapper types + * Get available user federation mapper types * * @return */ @@ -227,7 +227,7 @@ public class UserFederationProviderResource { } /** - * Create mapper + * Create a mapper * * @param mapper * @return @@ -251,9 +251,9 @@ public class UserFederationProviderResource { } /** - * Get mapper + * Get a mapper * - * @param id mapperId + * @param id Mapper id * @return */ @GET @@ -268,9 +268,9 @@ public class UserFederationProviderResource { } /** - * Update mapper + * Update a mapper * - * @param id + * @param id Mapper id * @param rep */ @PUT @@ -291,9 +291,9 @@ public class UserFederationProviderResource { } /** - * Delete mapper with given ID + * Delete a mapper with a given id * - * @param id + * @param id Mapper id */ @DELETE @NoCache diff --git a/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProvidersResource.java b/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProvidersResource.java index 294e633874..8946c36e72 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProvidersResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProvidersResource.java @@ -8,8 +8,6 @@ import org.keycloak.constants.KerberosConstants; import org.keycloak.events.admin.OperationType; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; -import org.keycloak.models.RequiredCredentialModel; -import org.keycloak.models.UserCredentialModel; import org.keycloak.models.UserFederationProvider; import org.keycloak.models.UserFederationProviderFactory; import org.keycloak.models.UserFederationProviderModel; @@ -84,7 +82,9 @@ public class UserFederationProvidersResource { } /** - * Get List of available provider factories + * Get available provider factories + * + * Returns a list of available provider factories. * * @return */ @@ -105,7 +105,7 @@ public class UserFederationProvidersResource { } /** - * Get factory with given ID + * Get factory with given id * * @return */ @@ -159,7 +159,7 @@ public class UserFederationProvidersResource { } /** - * list configured providers + * Get configured providers * * @return */ diff --git a/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java b/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java index e3e243788c..24aa35adaf 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java @@ -118,7 +118,7 @@ public class UsersResource { /** * Update the user * - * @param id + * @param id User id * @param rep * @return */ @@ -164,7 +164,9 @@ public class UsersResource { } /** - * Create a new user. Must be a unique username! + * Create a new user + * + * Username must be unique. * * @param uriInfo * @param rep @@ -245,7 +247,7 @@ public class UsersResource { /** * Get represenation of the user * - * @param id user id + * @param id User id * @return */ @Path("{id}") @@ -274,6 +276,12 @@ public class UsersResource { return rep; } + /** + * Impersonate the user + * + * @param id User id + * @return + */ @Path("{id}/impersonation") @POST @NoCache @@ -314,9 +322,9 @@ public class UsersResource { /** - * List set of sessions associated with this user. + * Get sessions associated with the user * - * @param id + * @param id User id * @return */ @Path("{id}/sessions") @@ -339,9 +347,9 @@ public class UsersResource { } /** - * List set of social logins associated with this user. + * Get social logins associated with the user * - * @param id + * @param id User id * @return */ @Path("{id}/federated-identity") @@ -373,6 +381,14 @@ public class UsersResource { return result; } + /** + * Add a social login provider to the user + * + * @param id User id + * @param provider Social login provider id + * @param rep + * @return + */ @Path("{id}/federated-identity/{provider}") @POST @NoCache @@ -392,6 +408,12 @@ public class UsersResource { return Response.noContent().build(); } + /** + * Remove a social login provider from user + * + * @param id User id + * @param provider Social login provider id + */ @Path("{id}/federated-identity/{provider}") @DELETE @NoCache @@ -408,9 +430,9 @@ public class UsersResource { } /** - * List set of consents granted by this user. + * Get consents granted by the user * - * @param id + * @param id User id * @return */ @Path("{id}/consents") @@ -435,10 +457,10 @@ public class UsersResource { } /** - * Revoke consent for particular client + * Revoke consent for particular client from user * - * @param id - * @param clientId + * @param id User id + * @param clientId Client id */ @Path("{id}/consents/{client}") @DELETE @@ -462,10 +484,11 @@ public class UsersResource { } /** - * Remove all user sessions associated with this user. And, for all client that have an admin URL, tell - * them to invalidate the sessions for this particular user. + * Remove all user sessions associated with the user * - * @param id user id + * Also send notification to all clients that have an admin URL to invalidate the sessions for the particular user. + * + * @param id User id */ @Path("{id}/logout") @POST @@ -484,9 +507,9 @@ public class UsersResource { } /** - * delete this user + * Delete the user * - * @param id user id + * @param id User id */ @Path("{id}") @DELETE @@ -509,13 +532,17 @@ public class UsersResource { } /** - * Query list of users. May pass in query criteria + * Get users * - * @param search string contained in username, first or last name, or email + * Returns a list of users, filtered according to query parameters + * + * @param search A String contained in username, first or last name, or email * @param last * @param first * @param email * @param username + * @param first Pagination offset + * @param maxResults Pagination size * @return */ @GET @@ -563,9 +590,9 @@ public class UsersResource { } /** - * Get role mappings for this user + * Get role mappings for the user * - * @param id user id + * @param id User id * @return */ @Path("{id}/role-mappings") @@ -614,9 +641,9 @@ public class UsersResource { } /** - * Get realm-level role mappings for this user + * Get realm-level role mappings for the user * - * @param id user id + * @param id User id * @return */ @Path("{id}/role-mappings/realm") @@ -640,9 +667,11 @@ public class UsersResource { } /** - * Effective realm-level role mappings for this user. Will recurse all composite roles to get this list. + * Get effective realm-level role mappings for the user * - * @param id user id + * This will recurse all composite roles to get the result. + * + * @param id User id * @return */ @Path("{id}/role-mappings/realm/composite") @@ -668,9 +697,9 @@ public class UsersResource { } /** - * Realm-level roles that can be mapped to this user + * Get realm-level roles that can be mapped to this user * - * @param id + * @param id User id * @return */ @Path("{id}/role-mappings/realm/available") @@ -690,10 +719,10 @@ public class UsersResource { } /** - * Add realm-level role mappings + * Add realm-level role mappings to the user * - * @param id - * @param roles + * @param id User id + * @param roles Roles to add */ @Path("{id}/role-mappings/realm") @POST @@ -720,7 +749,7 @@ public class UsersResource { /** * Delete realm-level role mappings * - * @param id user id + * @param id User id * @param roles */ @Path("{id}/role-mappings/realm") @@ -770,12 +799,14 @@ public class UsersResource { return new UserClientRoleMappingsResource(uriInfo, realm, auth, user, clientModel, adminEvent); } + /** - * Set up a temporary password for this user. User will have to reset this temporary password when they log - * in next. + * Set up a temporary password for the user * - * @param id - * @param pass temporary password + * User will have to reset the temporary password next time they log in. + * + * @param id User id + * @param pass A Temporary password */ @Path("{id}/reset-password") @PUT @@ -805,9 +836,9 @@ public class UsersResource { } /** + * Remove TOTP from the user * - * - * @param id + * @param id User id */ @Path("{id}/remove-totp") @PUT @@ -825,13 +856,15 @@ public class UsersResource { } /** - * Send an email to the user with a link they can click to reset their password. + * Send a password-reset email to the user + * + * An email contains a link the user can click to reset their password. * The redirectUri and clientId parameters are optional. The default for the * redirect is the account client. * - * @param id - * @param redirectUri redirect uri - * @param clientId client id + * @param id User is + * @param redirectUri Redirect uri + * @param clientId Client id * @return */ @Path("{id}/execute-actions-email") @@ -880,13 +913,15 @@ public class UsersResource { } /** - * Send an email to the user with a link they can click to verify their email address. + * Send an email-verification email to the user + * + * An email contains a link the user can click to verify their email address. * The redirectUri and clientId parameters are optional. The default for the * redirect is the account client. * - * @param id - * @param redirectUri redirect uri - * @param clientId client id + * @param id User id + * @param redirectUri Redirect uri + * @param clientId Client id * @return */ @Path("{id}/send-verify-email") diff --git a/services/src/main/java/org/keycloak/services/resources/admin/info/ServerInfoAdminResource.java b/services/src/main/java/org/keycloak/services/resources/admin/info/ServerInfoAdminResource.java index fd0afc9615..70022c0c21 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/info/ServerInfoAdminResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/info/ServerInfoAdminResource.java @@ -38,7 +38,7 @@ public class ServerInfoAdminResource { private KeycloakSession session; /** - * Returns a list of themes, social providers, auth providers, and event listeners available on this server + * Get themes, social providers, auth providers, and event listeners available on this server * * @return */ From 8396b999a203922e38e994cab6b3a8a5e07d2495 Mon Sep 17 00:00:00 2001 From: Marko Strukelj Date: Wed, 16 Sep 2015 11:53:53 +0200 Subject: [PATCH 30/35] KEYCLOAK-1241 Can't build release with Java 8 - Speed up build by only building REST API doc during -Pjboss-release --- services/pom.xml | 69 ++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/services/pom.xml b/services/pom.xml index bfb07ce768..3f6bd514d6 100755 --- a/services/pom.xml +++ b/services/pom.xml @@ -189,40 +189,6 @@ ${maven.compiler.target} - - org.apache.maven.plugins - maven-javadoc-plugin - - - generate-service-docs - generate-resources - - com.carma.swagger.doclet.ServiceDoclet - - com.carma - swagger-doclet - ${version.swagger.doclet} - - - org.keycloak.services.resources.admin:org.keycloak.protocol.oidc - false - - - ../javadocs - ${project.basedir}/../target/site/apidocs - - - - ${project.basedir}/target/apidocs-rest/swagger - false - -skipUiFiles -apiVersion 1 -includeResourcePrefixes org.keycloak.services.resources.admin,org.keycloak.protocol.oidc -docBasePath /apidocs -apiBasePath http://localhost:8080/auth -apiInfoFile ${project.basedir}/src/docs/swagger/apiinfo.json - - - javadoc - - - - @@ -243,6 +209,41 @@ + + org.apache.maven.plugins + maven-javadoc-plugin + + + generate-service-docs + generate-resources + + com.carma.swagger.doclet.ServiceDoclet + + com.carma + swagger-doclet + ${version.swagger.doclet} + + + org.keycloak.services.resources.admin:org.keycloak.protocol.oidc + false + + + ../javadocs + ${project.basedir}/../target/site/apidocs + + + + ${project.basedir}/target/apidocs-rest/swagger + false + -skipUiFiles -apiVersion 1 -includeResourcePrefixes org.keycloak.services.resources.admin,org.keycloak.protocol.oidc -docBasePath /apidocs -apiBasePath http://localhost:8080/auth -apiInfoFile ${project.basedir}/src/docs/swagger/apiinfo.json + + + javadoc + + + + + com.redowlanalytics swagger2markup-maven-plugin From 95967b9c79ed94750d9b4cb10f0a6a9a64c44501 Mon Sep 17 00:00:00 2001 From: Marko Strukelj Date: Mon, 14 Sep 2015 14:54:19 +0200 Subject: [PATCH 31/35] =?UTF-8?q?=EF=BB=BFKEYCLOAK-1852=20Improve=20Kerber?= =?UTF-8?q?os=20example=20documentation=20and=20user=20experience?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/kerberos/README.md | 154 +++++++++++++++++- examples/kerberos/kerberosrealm.json | 2 +- examples/kerberos/pom.xml | 4 + .../kerberos/impl/SPNEGOAuthenticator.java | 5 + .../util/ldap/KerberosKeytabCreator.java | 2 +- 5 files changed, 156 insertions(+), 11 deletions(-) diff --git a/examples/kerberos/README.md b/examples/kerberos/README.md index 7b95993ef8..c0f2800318 100644 --- a/examples/kerberos/README.md +++ b/examples/kerberos/README.md @@ -9,17 +9,22 @@ It also needs to enable forwardable ticket support in Kerberos configuration and Detailed steps: -**1)** Build and deploy this sample's WAR file. For this example, deploy on the same server that is running the Keycloak Server, although this is not required for real world scenarios. +**1)** Build and deploy this sample's WAR file. For this example, deploy on the same server that is running the Keycloak Server (the easiest way is to use Keycloak Demo distribution), although this is not required for real world scenarios. +If Keycloak Server is running locally, you can deploy the WAR using maven: -**2)** Copy `http.keytab` file from the root directory of example to `/tmp` directory (On Linux): + mvn wildfly:deploy +**2)** Open `kerberosrealm.json` file for edit. Find `keyTab` config property, and adjust the path to `http.keytab` file, which is in project's root directory, to be an absolute path. +For example: ``` -cp http.keytab /tmp/http.keytab + "keyTab" : "/home/user1/devel/keycloak/examples/kerberos/http.keytab" ``` -Alternative is to configure different location for `keyTab` property in `kerberosrealm.json` configuration file (On Windows this will be needed). -**WARNING**: In production, keytab file should be in secured location accessible just to the user under which is Keycloak server running. +On Windows you have to use forward slashes or double backslashes (\\) - e.g.`c:/Users/User1/devel/keycloak/examples/kerberos/http.keytab`. + +You can also move the file to another location if you want. +**WARNING**: In production, keytab file should be in secured location accessible only to the user under which the Keycloak server is running. **3)** Run Keycloak server and import `kerberosrealm.json` into it through admin console. This will import realm with sample application @@ -37,13 +42,16 @@ Also if you are on Linux, make sure that record like: ``` is in your `/etc/hosts` before other records for the 127.0.0.1 host to avoid issues related to incompatible reverse lookup (Ensure the similar for other OS as well) -**4)** Install kerberos client. This is platform dependent. If you are on Fedora, Ubuntu or RHEL, you can install package `freeipa-client`, which contains Kerberos client and bunch of other stuff. +**4)** Install kerberos client. This is platform dependent. If you are on Fedora, Ubuntu or RHEL, you can install package `freeipa-client`, which contains Kerberos client and bunch of other stuff. + **5)** Configure Kerberos client (On linux it's in file `/etc/krb5.conf` ). You need to configure `KEYCLOAK.ORG` realm for host `localhost` and enable `forwardable` flag, which is needed for credential delegation example, as application needs to forward Kerberos ticket and authenticate with it against LDAP server. See [this file](https://github.com/keycloak/keycloak/blob/master/testsuite/integration/src/test/resources/kerberos/test-krb5.conf) for inspiration. +On OS X the file to edit (or create) is `/Library/Preferences/edu.mit.Kerberos` with the same syntax as `krb5.conf`. +On Windows the file to edit (or create) is `c:\Windows\krb5.ini` with the same syntax as `krb5.conf`. -**6)** Run ApacheDS based LDAP server. You can run the command like this (assuming you're in the "kerberos" directory with this example): +**6)** Run ApacheDS based LDAP server. You can run the command like this (assuming you're in the `kerberos` directory with this example): ``` mvn exec:java -Pkerberos @@ -60,7 +68,7 @@ both `network.negotiate-auth.trusted-uris` and `network.negotiate-auth.delegatio A bit more details in [testsuite README](https://github.com/keycloak/keycloak/blob/master/misc/Testsuite.md#kerberos-server) . -**8)** Test the example. Obtain kerberos ticket by running command from CMD (on linux): +**8)** Test the example. Obtain kerberos ticket by running command from Terminal / CMD: ``` kinit hnelson@KEYCLOAK.ORG ``` @@ -68,4 +76,132 @@ with password `secret` . Then in your web browser open `http://localhost:8080/kerberos-portal` . You should be logged-in automatically through SPNEGO without displaying Keycloak login screen. Keycloak will also transmit the delegated GSS credential to the application inside access token and application will be able to login with this credential -to the LDAP server and retrieve some data from it (Actually it just retrieve few simple data about authenticated user himself). \ No newline at end of file +to the LDAP server and retrieve some data from it (Actually it just retrieve few simple data about authenticated user himself). + + +Troubleshooting +--------------- + +You followed the instructions, but things don't seem to be working. Follow these instructions to troubleshoot. + +**1)** Make sure to use the default user in all Terminal / CMD sessions. Do not use 'sudo' or 'su'. +The reason is that when you open Firefox, it will open within the context of currently signed in user. And it will use that user's Kerberos ticket to perform authentication. +When you obtain Kerberos ticket using Terminal session, you have to be that same user, otherwise the ticket will not be visible to the browser. + +Of course make sure to obtain the ticket: + +``` +kinit hnelson@KEYCLOAK.ORG +``` +with password `secret`. + + +**2)** On Linux make sure that the first entry in your /etc/hosts file is: +``` +127.0.0.1 localhost +``` + +Even if it already contains a similar entry like: + + 127.0.0.1 localhost.localdomain localhost + +Make sure to insert the short one before the existing one. + +**3)** Make sure you have properly adjusted the path to `http.keytab` file in `kerberosrealm.json`. +On Windows either use `/` as path delimiter or `\\` (two backslashes). + +**4)** Make sure that you have configured Firefox attributes via about:config url, and set `network.negotiate-auth.trusted-uris` and `network.negotiate-auth.delegation-uris` to `localhost`, +and `network.negotiate-auth.allow-non-fqdn` to `true`. + + + +Symptoms and solutions +---------------------- + +Here are some typical errors, and how to overcome them. It often helps to close and reopen browser, or restart servers in order for remedy to take effect. + + +### Symptom + + There is an error when starting embedded LDAP server: + +``` +GSSException: Invalid name provided (Mechanism level: KrbException: Cannot locate default realm) +``` +### Solution + + Make sure that krb5.conf file exists - location and file name is OS specific. See step no. 5 of the instructions. + + +### Symptom + + Browser redirects to normal login screen. There are no errors in Wildfly log. + +### Solution + + Make sure to perform `kinit`, and properly configure Firefox. See points no. 1, and no. 4 above. + + +### Symptom + + Browser redirects to a normal login screen. There is a warning in Wildfly log: + +``` +11:31:48,267 WARN [org.keycloak.federation.kerberos.impl.SPNEGOAuthenticator] (default task-6) GSS Context accepted, but no context initiator recognized. Check your kerberos configuration and reverse DNS lookup configuration +``` + + There is also a warning similar to the following in Embedded LDAP log: + +``` +11:31:47,923 WARN [org.apache.directory.server.KERBEROS_LOG] No server entry found for kerberos principal name HTTP/localhost.localdomain@KEYCLOAK.ORG +11:31:47,925 WARN [org.apache.directory.server.KERBEROS_LOG] Server not found in Kerberos database (7) +``` + +### Solution + + Make sure that 127.0.0.1 reverse resolution returns 'localhost'. See point no. 2 above. + + +### Symptom + + Browser redirects to a normal login screen. There is a stacktrace in Wildfly log: +``` +15:10:04,531 WARN [org.keycloak.federation.kerberos.impl.SPNEGOAuthenticator] (default task-3) SPNEGO login failed: java.security.PrivilegedActionException: GSSException: Failure unspecified at GSS-API level (Mechanism level: Invalid argument (400) - Cannot find key of appropriate type to decrypt AP REP - DES3 CBC mode with SHA1-KD) + at java.security.AccessController.doPrivileged(Native Method) + at javax.security.auth.Subject.doAs(Subject.java:422) + at org.keycloak.federation.kerberos.impl.SPNEGOAuthenticator.authenticate(SPNEGOAuthenticator.java:46) +``` + +### Solution + + Make sure `http.keytab` is available at the location specified in `kerberosrealm.json`. See point no. 3 above. + + +### Symptom + + Browser opens /kerberos-portal page, but reports an error retrieving user details from LDAP. There is a stacktrace in Wildfly log: +``` +15:29:39,685 ERROR [stderr] (default task-6) javax.naming.AuthenticationException: GSSAPI [Root exception is javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Server not found in Kerberos database (7) - Server not found in Kerberos database)]] +15:29:39,687 ERROR [stderr] (default task-6) at com.sun.jndi.ldap.sasl.LdapSasl.saslBind(LdapSasl.java:169) +15:29:39,687 ERROR [stderr] (default task-6) at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:236) +15:29:39,689 ERROR [stderr] (default task-6) at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2788) +``` + +### Solution + + Make sure `http.keytab` is available in location specified in `kerberosrealm.json`. See point no. 3 above. Also delete embedded server's cache directory: + + rm -rf /tmp/server-work-keycloakDS + + +### Symptom +``` +17:32:19,825 ERROR [stderr] (default task-24) org.keycloak.util.KerberosSerializationUtils$KerberosSerializationException: Null credential given as input. Did you enable kerberos credential delegation for your web browser and mapping of gss credential to access token?, Java version: 1.8.0_60, runtime version: 1.8.0_60-b27, vendor: Oracle Corporation, os: 4.1.6-200.fc22.x86_64 +17:32:19,826 ERROR [stderr] (default task-24) at org.keycloak.util.KerberosSerializationUtils.deserializeCredential(KerberosSerializationUtils.java:109) +17:32:19,827 ERROR [stderr] (default task-24) at org.keycloak.example.kerberos.GSSCredentialsClient.getUserFromLDAP(GSSCredentialsClient.java:42) +``` + +### Solution + + Make sure to properly configure Firefox. See point no. 4 above. + diff --git a/examples/kerberos/kerberosrealm.json b/examples/kerberos/kerberosrealm.json index c2deeac3bd..95d612bb13 100644 --- a/examples/kerberos/kerberosrealm.json +++ b/examples/kerberos/kerberosrealm.json @@ -86,7 +86,7 @@ "bindCredential" : "secret", "kerberosRealm" : "KEYCLOAK.ORG", "serverPrincipal" : "HTTP/localhost@KEYCLOAK.ORG", - "keyTab" : "/tmp/http.keytab" + "keyTab" : "http.keytab" } } ] diff --git a/examples/kerberos/pom.xml b/examples/kerberos/pom.xml index 02955dc79b..27d7071b6a 100755 --- a/examples/kerberos/pom.xml +++ b/examples/kerberos/pom.xml @@ -83,6 +83,10 @@ ldap.ldif kerberos-example-users.ldif + + workingDirectory + ${project.basedir}/target + diff --git a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/SPNEGOAuthenticator.java b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/SPNEGOAuthenticator.java index 9c56f75385..2252a87d88 100644 --- a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/SPNEGOAuthenticator.java +++ b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/SPNEGOAuthenticator.java @@ -106,6 +106,11 @@ public class SPNEGOAuthenticator { logAuthDetails(gssContext); if (gssContext.isEstablished()) { + if (gssContext.getSrcName() == null) { + log.warn("GSS Context accepted, but no context initiator recognized. Check your kerberos configuration and reverse DNS lookup configuration"); + return false; + } + authenticatedKerberosPrincipal = gssContext.getSrcName().toString(); if (gssContext.getCredDelegState()) { diff --git a/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosKeytabCreator.java b/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosKeytabCreator.java index 8863e7c531..72c90c0b39 100644 --- a/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosKeytabCreator.java +++ b/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosKeytabCreator.java @@ -35,7 +35,7 @@ public class KerberosKeytabCreator { System.out.println("-------------------------"); System.out.println("Arguments missing or invalid. Required arguments are: "); System.out.println("Example of usage:"); - System.out.println("java -jar embedded-ldap/target/embedded-ldap.jar keytabCreator HTTP/localhost@KEYCLOAK.ORG httppassword /tmp/http.keytab"); + System.out.println("java -jar embedded-ldap/target/embedded-ldap.jar keytabCreator HTTP/localhost@KEYCLOAK.ORG httppassword http.keytab"); } else { final File keytabFile = new File(args[2]); createKeytab(args[0], args[1], keytabFile); From a8378fe84bb7b54bf31732e11ca5d31dd0a9a6f0 Mon Sep 17 00:00:00 2001 From: Stan Silvert Date: Wed, 16 Sep 2015 07:40:14 -0400 Subject: [PATCH 32/35] Update client-credentials-jwt-key-export.html --- .../resources/partials/client-credentials-jwt-key-export.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-export.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-export.html index ad21e93e7d..08c1dcd811 100644 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-export.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-export.html @@ -3,7 +3,7 @@ @@ -54,4 +54,4 @@
- \ No newline at end of file + From ae54babbbbe1e5f3215ec175dae64c17877327cf Mon Sep 17 00:00:00 2001 From: Stan Silvert Date: Wed, 16 Sep 2015 07:40:30 -0400 Subject: [PATCH 33/35] Update client-credentials-jwt-key-import.html --- .../resources/partials/client-credentials-jwt-key-import.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-import.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-import.html index 41c1be5a2a..a3556ea5e4 100644 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-import.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/client-credentials-jwt-key-import.html @@ -3,7 +3,7 @@ @@ -59,4 +59,4 @@
- \ No newline at end of file + From b7e49dc88df6485665494d47b6bb7809c3d0b195 Mon Sep 17 00:00:00 2001 From: Lukas Kubik Date: Wed, 16 Sep 2015 17:03:32 +0200 Subject: [PATCH 34/35] Unify jetty 8.1 artifacts version with fabric8-bom-1.2.0.redhat-133.pom --- integration/jetty/jetty-core/pom.xml | 2 +- integration/jetty/jetty8.1/pom.xml | 2 +- integration/osgi-adapter/pom.xml | 2 +- testsuite/jetty/jetty81/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/integration/jetty/jetty-core/pom.xml b/integration/jetty/jetty-core/pom.xml index aa02a1c627..93504df597 100755 --- a/integration/jetty/jetty-core/pom.xml +++ b/integration/jetty/jetty-core/pom.xml @@ -12,7 +12,7 @@ keycloak-jetty-core Keycloak Jetty Core Integration - 8.1.16.v20140903 + 8.1.17.v20150415 org.keycloak.adapters.jetty.core.* diff --git a/integration/jetty/jetty8.1/pom.xml b/integration/jetty/jetty8.1/pom.xml index 7c03844e11..81625f443e 100755 --- a/integration/jetty/jetty8.1/pom.xml +++ b/integration/jetty/jetty8.1/pom.xml @@ -12,7 +12,7 @@ keycloak-jetty81-adapter Keycloak Jetty 8.1.x Integration - 8.1.16.v20140903 + 8.1.17.v20150415 org.keycloak.adapters.jetty.* diff --git a/integration/osgi-adapter/pom.xml b/integration/osgi-adapter/pom.xml index 43be02d480..0f01b8f829 100755 --- a/integration/osgi-adapter/pom.xml +++ b/integration/osgi-adapter/pom.xml @@ -14,7 +14,7 @@ jar - 8.1.16.v20140903 + 8.1.17.v20150415 org.keycloak.adapters.osgi.* diff --git a/testsuite/jetty/jetty81/pom.xml b/testsuite/jetty/jetty81/pom.xml index 595fdf27c1..5fd9e6a303 100755 --- a/testsuite/jetty/jetty81/pom.xml +++ b/testsuite/jetty/jetty81/pom.xml @@ -12,7 +12,7 @@ keycloak-testsuite-jetty81 Keycloak Jetty 8.1.x Integration TestSuite - 8.1.16.v20140903 + 8.1.17.v20150415 From 2eaa03539ca927e18e30412bd4647f1c72e256a7 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Thu, 17 Sep 2015 07:38:14 +0200 Subject: [PATCH 35/35] KEYCLOAK-1854 NPE in SystemInfoRepresentation if user.country or user.language not set --- .../resources/admin/info/SystemInfoRepresentation.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/src/main/java/org/keycloak/services/resources/admin/info/SystemInfoRepresentation.java b/services/src/main/java/org/keycloak/services/resources/admin/info/SystemInfoRepresentation.java index bc0329a785..e34edc9eea 100644 --- a/services/src/main/java/org/keycloak/services/resources/admin/info/SystemInfoRepresentation.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/info/SystemInfoRepresentation.java @@ -46,7 +46,9 @@ public class SystemInfoRepresentation { rep.userName = System.getProperty("user.name"); rep.userDir = System.getProperty("user.dir"); rep.userTimezone = System.getProperty("user.timezone"); - rep.userLocale = (new Locale(System.getProperty("user.country"), System.getProperty("user.language")).toString()); + if (System.getProperty("user.country") != null && System.getProperty("user.language") != null) { + rep.userLocale = (new Locale(System.getProperty("user.country"), System.getProperty("user.language")).toString()); + } return rep; }