From 873cf869e991247373384aaf43efd8694dc789f4 Mon Sep 17 00:00:00 2001 From: Yuriy Movchan Date: Tue, 29 Oct 2024 20:18:25 +0300 Subject: [PATCH] Lock health check plugin (#9928) * fix(jans-lock): add health-check plugiun form jans-auth Signed-off-by: Yuriy Movchan * fix(jans-lock): add health-check plugiun form jans-auth Signed-off-by: Yuriy Movchan * fix(jans-lock): add health-check plugiun form jans-auth Signed-off-by: Yuriy Movchan * feat(oxauth): ignore uid case when auth server is AD Signed-off-by: Yuriy Movchan --------- Signed-off-by: Yuriy Movchan --- .../java/io/jans/as/server/service/AuthenticationService.java | 3 ++- .../jans/as/server/ws/rs/controller/HealthCheckController.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/jans-auth-server/server/src/main/java/io/jans/as/server/service/AuthenticationService.java b/jans-auth-server/server/src/main/java/io/jans/as/server/service/AuthenticationService.java index d5e2eb37ed2..a0ffe8fdb84 100644 --- a/jans-auth-server/server/src/main/java/io/jans/as/server/service/AuthenticationService.java +++ b/jans-auth-server/server/src/main/java/io/jans/as/server/service/AuthenticationService.java @@ -455,7 +455,8 @@ private boolean authenticateImpl(GluuLdapConfiguration ldapAuthConfig, Persisten log.debug("User authenticated: {}", userDn); log.debug("Attempting to find userDN by local primary key: {}", localPrimaryKey); - User localUser = userService.getUserByAttribute(localPrimaryKey, keyValue); + String lowerKeyValue = StringHelper.toLowerCase(keyValue); + User localUser = userService.getUserByAttributes(lowerKeyValue, new String[] {localPrimaryKey}, new String[] {"uid", "jansStatus"}); if (localUser != null) { if (!checkUserStatus(localUser)) { return false; diff --git a/jans-auth-server/server/src/main/java/io/jans/as/server/ws/rs/controller/HealthCheckController.java b/jans-auth-server/server/src/main/java/io/jans/as/server/ws/rs/controller/HealthCheckController.java index 84c17d0e6ec..afa57adb73c 100644 --- a/jans-auth-server/server/src/main/java/io/jans/as/server/ws/rs/controller/HealthCheckController.java +++ b/jans-auth-server/server/src/main/java/io/jans/as/server/ws/rs/controller/HealthCheckController.java @@ -76,7 +76,7 @@ public String healthCheckController(@Context HttpServletRequest httpRequest, @Co String healthCheckService = healthCheckPluginService.provideServiceName(); String healthCheckData = healthCheckPluginService.provideHealthCheckData(); if (StringHelper.isNotEmpty(healthCheckService) && StringHelper.isNotEmpty(healthCheckData)) { - sb.append(String.format("\"%s\": %s", healthCheckService, healthCheckData)); + sb.append(String.format(", \"%s\": %s", healthCheckService, healthCheckData)); } }