KEYCLOAK-12526: Add 'Always Display in Console' to admin console
This commit is contained in:
parent
648c6f811c
commit
568b1586a6
8 changed files with 29 additions and 2 deletions
|
@ -556,6 +556,7 @@ public class ClientTest extends AbstractAdminTest {
|
||||||
if (client.getClientId() != null) Assert.assertEquals(client.getClientId(), storedClient.getClientId());
|
if (client.getClientId() != null) Assert.assertEquals(client.getClientId(), storedClient.getClientId());
|
||||||
if (client.getName() != null) Assert.assertEquals(client.getName(), storedClient.getName());
|
if (client.getName() != null) Assert.assertEquals(client.getName(), storedClient.getName());
|
||||||
if (client.isEnabled() != null) Assert.assertEquals(client.isEnabled(), storedClient.isEnabled());
|
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.isBearerOnly() != null) Assert.assertEquals(client.isBearerOnly(), storedClient.isBearerOnly());
|
||||||
if (client.isPublicClient() != null) Assert.assertEquals(client.isPublicClient(), storedClient.isPublicClient());
|
if (client.isPublicClient() != null) Assert.assertEquals(client.isPublicClient(), storedClient.isPublicClient());
|
||||||
if (client.isFullScopeAllowed() != null) Assert.assertEquals(client.isFullScopeAllowed(), storedClient.isFullScopeAllowed());
|
if (client.isFullScopeAllowed() != null) Assert.assertEquals(client.isFullScopeAllowed(), storedClient.isFullScopeAllowed());
|
||||||
|
|
|
@ -106,6 +106,7 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<systemProperties>
|
<systemProperties>
|
||||||
<keycloak.theme.dir>${keycloak.theme.dir}</keycloak.theme.dir>
|
<keycloak.theme.dir>${keycloak.theme.dir}</keycloak.theme.dir>
|
||||||
|
<keycloak.profile.feature.account2>enabled</keycloak.profile.feature.account2>
|
||||||
</systemProperties>
|
</systemProperties>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -33,6 +33,9 @@ public class ClientSettingsForm extends CreateClientForm {
|
||||||
@FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='enabled']]")
|
@FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='enabled']]")
|
||||||
private OnOffSwitch enabledSwitch;
|
private OnOffSwitch enabledSwitch;
|
||||||
|
|
||||||
|
@FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='alwaysDisplayInConsole']]")
|
||||||
|
private OnOffSwitch alwaysDisplayInConsole;
|
||||||
|
|
||||||
@FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='consentRequired']]")
|
@FindBy(xpath = ".//div[@class='onoffswitch' and ./input[@id='consentRequired']]")
|
||||||
private OnOffSwitch consentRequiredSwitch;
|
private OnOffSwitch consentRequiredSwitch;
|
||||||
|
|
||||||
|
@ -146,6 +149,14 @@ public class ClientSettingsForm extends CreateClientForm {
|
||||||
enabledSwitch.setOn(enabled);
|
enabledSwitch.setOn(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isAlwaysDisplayInConsole() {
|
||||||
|
return alwaysDisplayInConsole.isOn();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlwaysDisplayInConsole(boolean enabled) {
|
||||||
|
alwaysDisplayInConsole.setOn(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isConsentRequired() {
|
public boolean isConsentRequired() {
|
||||||
return consentRequiredSwitch.isOn();
|
return consentRequiredSwitch.isOn();
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,6 +105,7 @@ public abstract class AbstractClientTest extends AbstractConsoleTest {
|
||||||
assertEqualsStringAttributes(c1.getClientId(), c2.getClientId());
|
assertEqualsStringAttributes(c1.getClientId(), c2.getClientId());
|
||||||
assertEqualsStringAttributes(c1.getName(), c2.getName());
|
assertEqualsStringAttributes(c1.getName(), c2.getName());
|
||||||
assertEqualsBooleanAttributes(c1.isEnabled(), c2.isEnabled());
|
assertEqualsBooleanAttributes(c1.isEnabled(), c2.isEnabled());
|
||||||
|
assertEqualsBooleanAttributes(c1.isAlwaysDisplayInConsole(), c2.isAlwaysDisplayInConsole());
|
||||||
assertEqualsStringAttributes(c1.getBaseUrl(), c2.getBaseUrl());
|
assertEqualsStringAttributes(c1.getBaseUrl(), c2.getBaseUrl());
|
||||||
assertEqualsBooleanAttributes(c1.isConsentRequired(), c2.isConsentRequired());
|
assertEqualsBooleanAttributes(c1.isConsentRequired(), c2.isConsentRequired());
|
||||||
assertEqualsStringAttributes(c1.getProtocol(), c2.getProtocol());
|
assertEqualsStringAttributes(c1.getProtocol(), c2.getProtocol());
|
||||||
|
|
|
@ -61,6 +61,7 @@ public class ClientSettingsTest extends AbstractClientTest {
|
||||||
// update & verify
|
// update & verify
|
||||||
newClient.setClientId("oidc-public-updated");
|
newClient.setClientId("oidc-public-updated");
|
||||||
newClient.setName("updatedName");
|
newClient.setName("updatedName");
|
||||||
|
newClient.setAlwaysDisplayInConsole(true);
|
||||||
|
|
||||||
List<String> redirectUris = new ArrayList<>();
|
List<String> redirectUris = new ArrayList<>();
|
||||||
redirectUris.add("http://example2.test/app/*");
|
redirectUris.add("http://example2.test/app/*");
|
||||||
|
@ -76,6 +77,7 @@ public class ClientSettingsTest extends AbstractClientTest {
|
||||||
|
|
||||||
clientSettingsPage.form().setClientId("oidc-public-updated");
|
clientSettingsPage.form().setClientId("oidc-public-updated");
|
||||||
clientSettingsPage.form().setName("updatedName");
|
clientSettingsPage.form().setName("updatedName");
|
||||||
|
clientSettingsPage.form().setAlwaysDisplayInConsole(true);
|
||||||
clientSettingsPage.form().setRedirectUris(redirectUris);
|
clientSettingsPage.form().setRedirectUris(redirectUris);
|
||||||
clientSettingsPage.form().setWebOrigins(webOrigins);
|
clientSettingsPage.form().setWebOrigins(webOrigins);
|
||||||
clientSettingsPage.form().save();
|
clientSettingsPage.form().save();
|
||||||
|
|
|
@ -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-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.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.
|
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=Consent Required
|
||||||
consent-required.tooltip=If enabled, users have to consent to client access.
|
consent-required.tooltip=If enabled, users have to consent to client access.
|
||||||
client.display-on-consent-screen=Display Client On Consent Screen
|
client.display-on-consent-screen=Display Client On Consent Screen
|
||||||
|
|
|
@ -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) {
|
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.flows = [];
|
||||||
$scope.clientFlows = [];
|
$scope.clientFlows = [];
|
||||||
var emptyFlow = {
|
var emptyFlow = {
|
||||||
|
@ -1279,6 +1280,7 @@ module.controller('ClientDetailCtrl', function($scope, realm, client, flows, $ro
|
||||||
} else if ($scope.accessType == "bearer-only") {
|
} else if ($scope.accessType == "bearer-only") {
|
||||||
$scope.clientEdit.bearerOnly = true;
|
$scope.clientEdit.bearerOnly = true;
|
||||||
$scope.clientEdit.publicClient = false;
|
$scope.clientEdit.publicClient = false;
|
||||||
|
$scope.clientEdit.alwaysDisplayInConsole = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,13 @@
|
||||||
</div>
|
</div>
|
||||||
<kc-tooltip>{{:: 'client.enabled.tooltip' | translate}}</kc-tooltip>
|
<kc-tooltip>{{:: 'client.enabled.tooltip' | translate}}</kc-tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group clearfix block" data-ng-show="serverInfo.featureEnabled('ACCOUNT2') && accessType !== 'bearer-only'">
|
||||||
|
<label class="col-md-2 control-label" for="alwaysDisplayInConsole">{{:: 'alwaysDisplayInConsole' | translate}}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input ng-model="clientEdit.alwaysDisplayInConsole" name="alwaysDisplayInConsole" id="alwaysDisplayInConsole" onoffswitch on-text="{{:: 'onText' | translate}}" off-text="{{:: 'offText' | translate}}"/>
|
||||||
|
</div>
|
||||||
|
<kc-tooltip>{{:: 'alwaysDisplayInConsole.tooltip' | translate}}</kc-tooltip>
|
||||||
|
</div>
|
||||||
<div class="form-group clearfix block" data-ng-show="client.origin">
|
<div class="form-group clearfix block" data-ng-show="client.origin">
|
||||||
<label class="col-md-2 control-label">{{:: 'client-origin-link' | translate}}</label>
|
<label class="col-md-2 control-label">{{:: 'client-origin-link' | translate}}</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
|
Loading…
Reference in a new issue