From 567bbe1f5ad78c1cb85dfce97cf2f73ba9271b12 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 26 Sep 2022 21:48:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(ldap):=20ldap=E7=94=A8=E6=88=B7=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E4=B8=BA=E7=A9=BA=E6=97=A0=E6=B3=95=E7=99=BB=E5=BD=95?= =?UTF-8?q?DE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/io/dataease/auth/server/AuthServer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/main/java/io/dataease/auth/server/AuthServer.java b/backend/src/main/java/io/dataease/auth/server/AuthServer.java index b367411469..6cb82b4968 100644 --- a/backend/src/main/java/io/dataease/auth/server/AuthServer.java +++ b/backend/src/main/java/io/dataease/auth/server/AuthServer.java @@ -47,6 +47,7 @@ import javax.servlet.http.HttpSession; @RestController public class AuthServer implements AuthApi { + private static final String LDAP_EMAIL_SUFFIX = "@ldap.com"; @Value("${dataease.init_password:DataEase123..}") private String DEFAULT_PWD; @@ -83,6 +84,9 @@ public class AuthServer implements AuthApi { DataEaseException.throwException(validateResult.getMsg()); } XpackLdapUserEntity ldapUserEntity = validateResult.getData(); + if (StringUtils.isBlank(ldapUserEntity.getEmail())) { + ldapUserEntity.setEmail(username + LDAP_EMAIL_SUFFIX); + } SysUserEntity user = authUserService.getLdapUserByName(username); if (ObjectUtils.isEmpty(user) || ObjectUtils.isEmpty(user.getUserId())) { LdapAddRequest ldapAddRequest = new LdapAddRequest();