Skip to content
Snippets Groups Projects
Commit a7a5933b authored by Philippe Larose's avatar Philippe Larose
Browse files

ad-connector: fix all users revoked when AD is down

Fix f037a08d didn't work for active directory since
UserProfileService.getUserProfile returns an empty array instead of null
for Active Directory. In this case we must also check for an empty array
in order to identify that the AD server is down.

Ticket: https://redmine.savoirfairelinux.com/issues/7656
Change-Id: Icda219ec5f85b5b40e7a0c56957b2eb1dcd4f866
parent 2309ed6a
No related branches found
No related tags found
No related merge requests found
......@@ -203,7 +203,7 @@ public class UserProfileService {
List<UserProfile> profilesFromAD =
getUserProfile("*", "LOGON_NAME", false, Optional.empty());
// Do not revoke users if there is an error, the AD server could be down.
if (profilesFromAD != null) {
if (profilesFromAD != null && !profilesFromAD.isEmpty()) {
// There is a use case where a user is not in the AD server but is in the database.
// When this happens, we need to revoke the user from the database.
List<UserProfile> profilesFromDatabase =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment