This is an automated email from the ASF dual-hosted git repository.

benjobs pushed a commit to branch dev-2.1.1
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev-2.1.1 by this push:
     new 522cf6a19 [BUG] fix ldap login error in dev-2.1.1 (#2775)
522cf6a19 is described below

commit 522cf6a197b3a7f5d7f11bb1cf2eb1e00c370ca8
Author: zhoulii <[email protected]>
AuthorDate: Mon May 29 22:24:03 2023 +0800

    [BUG] fix ldap login error in dev-2.1.1 (#2775)
    
    Co-authored-by: zhoulii <[email protected]>
---
 .../apache/streampark/console/system/security/impl/LdapService.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/security/impl/LdapService.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/security/impl/LdapService.java
index bcbc573eb..2eb0043a4 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/security/impl/LdapService.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/security/impl/LdapService.java
@@ -82,11 +82,12 @@ public class LdapService {
       ldapEnv = new Properties();
       ldapEnv.put(Context.INITIAL_CONTEXT_FACTORY, 
"com.sun.jndi.ldap.LdapCtxFactory");
       ldapEnv.put(Context.SECURITY_AUTHENTICATION, "simple");
-      ldapEnv.put(Context.SECURITY_PRINCIPAL, ldapSecurityPrincipal);
-      ldapEnv.put(Context.SECURITY_CREDENTIALS, ldapPrincipalPassword);
       ldapEnv.put(Context.PROVIDER_URL, ldapUrls);
     }
 
+    ldapEnv.put(Context.SECURITY_PRINCIPAL, ldapSecurityPrincipal);
+    ldapEnv.put(Context.SECURITY_CREDENTIALS, ldapPrincipalPassword);
+
     try {
       LdapContext ctx = new InitialLdapContext(ldapEnv, null);
       SearchControls sc = new SearchControls();

Reply via email to