KEYCLOAK-13397 Creating role-ldap-mapper for realm-management client id in ldap user federation fails - alternative

This commit is contained in:
mposolda 2020-03-25 18:51:06 +01:00 committed by Hynek Mlnařík
parent 330d5b2c25
commit 9ec137a50c
3 changed files with 8 additions and 4 deletions

View file

@ -2790,14 +2790,18 @@ module.controller('ProviderConfigCtrl', function ($modal, $scope, $route, Compon
})
}
$scope.changeClient = function(configName, config, client) {
$scope.changeClient = function(configName, config, client, multivalued) {
if (!client || !client.id) {
config[configName] = null;
$scope.selectedClient = null;
return;
}
$scope.selectedClient = client;
if (multivalued) {
config[configName][0] = client.clientId;
} else {
config[configName] = client.clientId;
}
};
ComponentUtils.convertAllMultivaluedStringValuesToList($scope.properties, $scope.config);

View file

@ -30,7 +30,7 @@
</div>
</div>
<div class="col-md-4" data-ng-if="option.type == 'ClientList'">
<input type="hidden" ui-select2="clientsUiSelect" id="clients" data-ng-init="initSelectedClient(option.name, config)" data-ng-model="selectedClient" data-ng-change="changeClient(option.name, config, selectedClient);" data-placeholder="{{:: 'selectOne' | translate}}...">
<input type="hidden" ui-select2="clientsUiSelect" id="clients" data-ng-init="initSelectedClient(option.name, config)" data-ng-model="selectedClient" data-ng-change="changeClient(option.name, config, selectedClient, true);" data-placeholder="{{:: 'selectOne' | translate}}...">
</input>
</div>

View file

@ -27,7 +27,7 @@
</div>
</div>
<div class="col-md-4" data-ng-if="option.type == 'ClientList'">
<input type="hidden" ui-select2="clientsUiSelect" id="clients" data-ng-init="initSelectedClient(option.name, config)" data-ng-model="selectedClient" data-ng-change="changeClient(option.name, config, selectedClient);" data-placeholder="{{:: 'selectOne' | translate}}...">
<input type="hidden" ui-select2="clientsUiSelect" id="clients" data-ng-init="initSelectedClient(option.name, config)" data-ng-model="selectedClient" data-ng-change="changeClient(option.name, config, selectedClient, false);" data-placeholder="{{:: 'selectOne' | translate}}...">
</input>
</div>