Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDAP is prohibited in conflict with the local user. #2050

Merged
merged 2 commits into from
Jun 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ private User ldapLogin(LoginDTO loginDTO) throws AuthException {
userIds.add(user.getId());
tenantService.assignUserToTenant(new AssignUserToTenantParams(tenant.getId(), userIds));
return user;
} else if (userFromLocal.getUserType() != UserType.LDAP.getCode()) {
throw new AuthException(Status.LDAP_LOGIN_FORBID);
}

// If local database have the user and ldap login is pass,
Expand Down
5 changes: 5 additions & 0 deletions dinky-common/src/main/java/org/dinky/data/enums/Status.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ public enum Status {
"If the user filter rule cannot be empty, enter the relevant configuration",
"用户过滤规则不能为空,请填写相关配置"),

LDAP_LOGIN_FORBID(
18007,
"If the current user login mode is not LDAP, contact the administrator to modify it, or do not use LDAP to log in",
"当前用户登录模式不是LDAP,请联系管理员修改,或不使用LDAP登录"),

/** global exception */
GLOBAL_PARAMS_CHECK_ERROR(90001, "Field: {0}, {1}", "字段: {0}, {1}"),
GLOBAL_PARAMS_CHECK_ERROR_VALUE(90002, "Field: {0}, Illegal Value: {1}", "字段: {0}, 不合法的值: {1}"),
Expand Down