From 47ba863328e2917bbbd22e51364ffc2cbba050a0 Mon Sep 17 00:00:00 2001 From: ShawHee Date: Fri, 9 Aug 2024 15:18:31 +0800 Subject: [PATCH] [Bug] Fix: Set a default password for Ldap user (#3955) * set default password * modify constant name --------- Co-authored-by: hechao --- .../java/org/apache/streampark/console/system/entity/User.java | 2 ++ .../console/system/security/impl/AuthenticatorImpl.java | 1 + 2 files changed, 3 insertions(+) diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/entity/User.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/entity/User.java index c348439356..f1a4a237a6 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/entity/User.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/entity/User.java @@ -52,6 +52,8 @@ public class User extends BaseEntity { public static final Integer DEFAULT_PASSWORD_LENGTH = 8; + public static final String DEFAULT_SECRET = "streampark"; + @TableId(type = IdType.AUTO) private Long userId; diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/security/impl/AuthenticatorImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/security/impl/AuthenticatorImpl.java index b315014adc..8b61003d5a 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/security/impl/AuthenticatorImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/security/impl/AuthenticatorImpl.java @@ -119,6 +119,7 @@ private User newUserCreate(LoginTypeEnum loginTypeEnum, String username) throws newUser.setUserType(UserTypeEnum.USER); newUser.setStatus(User.STATUS_VALID); newUser.setSex(User.SEX_UNKNOWN); + newUser.setPassword(User.DEFAULT_SECRET); usersService.createUser(newUser); return newUser; }