diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ClientTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ClientTest.java index 07755cadab..794d82832c 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ClientTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ClientTest.java @@ -556,6 +556,7 @@ public class ClientTest extends AbstractAdminTest { if (client.getClientId() != null) Assert.assertEquals(client.getClientId(), storedClient.getClientId()); if (client.getName() != null) Assert.assertEquals(client.getName(), storedClient.getName()); if (client.isEnabled() != null) Assert.assertEquals(client.isEnabled(), storedClient.isEnabled()); + if (client.isAlwaysDisplayInConsole() != null) Assert.assertEquals(client.isAlwaysDisplayInConsole(), storedClient.isAlwaysDisplayInConsole()); if (client.isBearerOnly() != null) Assert.assertEquals(client.isBearerOnly(), storedClient.isBearerOnly()); if (client.isPublicClient() != null) Assert.assertEquals(client.isPublicClient(), storedClient.isPublicClient()); if (client.isFullScopeAllowed() != null) Assert.assertEquals(client.isFullScopeAllowed(), storedClient.isFullScopeAllowed()); diff --git a/testsuite/integration-arquillian/tests/other/console/pom.xml b/testsuite/integration-arquillian/tests/other/console/pom.xml index 11661ee79b..e0b2fff515 100644 --- a/testsuite/integration-arquillian/tests/other/console/pom.xml +++ b/testsuite/integration-arquillian/tests/other/console/pom.xml @@ -106,6 +106,7 @@ ${keycloak.theme.dir} + enabled diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/settings/ClientSettingsForm.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/settings/ClientSettingsForm.java index b8745964ef..978c902f3a 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/settings/ClientSettingsForm.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/settings/ClientSettingsForm.java @@ -33,6 +33,9 @@ public class ClientSettingsForm extends CreateClientForm { @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='enabled']]") private OnOffSwitch enabledSwitch; + @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='alwaysDisplayInConsole']]") + private OnOffSwitch alwaysDisplayInConsole; + @FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='consentRequired']]") private OnOffSwitch consentRequiredSwitch; @@ -145,6 +148,14 @@ public class ClientSettingsForm extends CreateClientForm { public void setEnabled(boolean enabled) { enabledSwitch.setOn(enabled); } + + public boolean isAlwaysDisplayInConsole() { + return alwaysDisplayInConsole.isOn(); + } + + public void setAlwaysDisplayInConsole(boolean enabled) { + alwaysDisplayInConsole.setOn(enabled); + } public boolean isConsentRequired() { return consentRequiredSwitch.isOn(); diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/AbstractClientTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/AbstractClientTest.java index 103f7130d4..5243003b3d 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/AbstractClientTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/AbstractClientTest.java @@ -105,6 +105,7 @@ public abstract class AbstractClientTest extends AbstractConsoleTest { assertEqualsStringAttributes(c1.getClientId(), c2.getClientId()); assertEqualsStringAttributes(c1.getName(), c2.getName()); assertEqualsBooleanAttributes(c1.isEnabled(), c2.isEnabled()); + assertEqualsBooleanAttributes(c1.isAlwaysDisplayInConsole(), c2.isAlwaysDisplayInConsole()); assertEqualsStringAttributes(c1.getBaseUrl(), c2.getBaseUrl()); assertEqualsBooleanAttributes(c1.isConsentRequired(), c2.isConsentRequired()); assertEqualsStringAttributes(c1.getProtocol(), c2.getProtocol()); diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientSettingsTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientSettingsTest.java index 656759bda6..d68cc2e17d 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientSettingsTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientSettingsTest.java @@ -47,7 +47,7 @@ public class ClientSettingsTest extends AbstractClientTest { private ClientSettings clientSettingsPage; private ClientRepresentation newClient; - + @Test public void crudOIDCPublic() { newClient = createClientRep("oidc-public", OIDC); @@ -61,6 +61,7 @@ public class ClientSettingsTest extends AbstractClientTest { // update & verify newClient.setClientId("oidc-public-updated"); newClient.setName("updatedName"); + newClient.setAlwaysDisplayInConsole(true); List redirectUris = new ArrayList<>(); redirectUris.add("http://example2.test/app/*"); @@ -76,6 +77,7 @@ public class ClientSettingsTest extends AbstractClientTest { clientSettingsPage.form().setClientId("oidc-public-updated"); clientSettingsPage.form().setName("updatedName"); + clientSettingsPage.form().setAlwaysDisplayInConsole(true); clientSettingsPage.form().setRedirectUris(redirectUris); clientSettingsPage.form().setWebOrigins(webOrigins); clientSettingsPage.form().save(); diff --git a/themes/src/main/resources/theme/base/admin/messages/admin-messages_en.properties b/themes/src/main/resources/theme/base/admin/messages/admin-messages_en.properties index cfb1df93e3..26ce027450 100644 --- a/themes/src/main/resources/theme/base/admin/messages/admin-messages_en.properties +++ b/themes/src/main/resources/theme/base/admin/messages/admin-messages_en.properties @@ -280,6 +280,8 @@ clear-import=Clear import client-id.tooltip=Specifies ID referenced in URI and tokens. For example 'my-client'. For SAML this is also the expected issuer value from authn requests client.name.tooltip=Specifies display name of the client. For example 'My Client'. Supports keys for localized values as well. For example\: ${my_client} client.enabled.tooltip=Disabled clients cannot initiate a login or have obtain access tokens. +alwaysDisplayInConsole=Always Display in Console +alwaysDisplayInConsole.tooltip=Always list this client in the Account Console, even if the user does not have an active session. consent-required=Consent Required consent-required.tooltip=If enabled, users have to consent to client access. client.display-on-consent-screen=Display Client On Consent Screen diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js index b94fc71436..a47ff6ceae 100755 --- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js +++ b/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js @@ -683,7 +683,7 @@ module.controller('ClientRoleDetailCtrl', function($scope, $route, realm, client $scope.create = !role.name; $scope.changed = $scope.create; - + $scope.save = function() { convertAttributeValuesToLists(); if ($scope.create) { @@ -967,6 +967,7 @@ module.controller('ClientInstallationCtrl', function($scope, realm, client, serv module.controller('ClientDetailCtrl', function($scope, realm, client, flows, $route, serverInfo, Client, ClientDescriptionConverter, Components, ClientStorageOperations, $location, $modal, Dialog, Notifications, TimeUnit2) { + $scope.serverInfo = serverInfo; $scope.flows = []; $scope.clientFlows = []; var emptyFlow = { @@ -1279,6 +1280,7 @@ module.controller('ClientDetailCtrl', function($scope, realm, client, flows, $ro } else if ($scope.accessType == "bearer-only") { $scope.clientEdit.bearerOnly = true; $scope.clientEdit.publicClient = false; + $scope.clientEdit.alwaysDisplayInConsole = false; } }; diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/client-detail.html b/themes/src/main/resources/theme/base/admin/resources/partials/client-detail.html index 7bb63af0a1..cc59cd866b 100755 --- a/themes/src/main/resources/theme/base/admin/resources/partials/client-detail.html +++ b/themes/src/main/resources/theme/base/admin/resources/partials/client-detail.html @@ -37,6 +37,13 @@ {{:: 'client.enabled.tooltip' | translate}} +
+ +
+ +
+ {{:: 'alwaysDisplayInConsole.tooltip' | translate}} +