diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js b/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js index 392e726fd7..251a62f712 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js @@ -925,7 +925,13 @@ module.controller('RealmLDAPSettingsCtrl', function($scope, $location, Notificat console.log("LDAP vendor changed"); $scope.lastVendor = $scope.realm.ldapServer.vendor; - $scope.realm.ldapServer.usernameLDAPAttribute = ($scope.lastVendor === "ad") ? "cn" : "uid"; + if ($scope.lastVendor === "ad") { + $scope.realm.ldapServer.usernameLDAPAttribute = "cn"; + $scope.realm.ldapServer.userObjectClasses = "person, organizationalPerson"; + } else { + $scope.realm.ldapServer.usernameLDAPAttribute = "uid"; + $scope.realm.ldapServer.userObjectClasses = "inetOrgPerson, organizationalPerson"; + } } }, true); diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-ldap.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-ldap.html index 6cbf2692ea..edf8eced93 100644 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-ldap.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-ldap.html @@ -35,6 +35,12 @@ +