繁体   English   中英

LDAP:错误代码 49 - 80090308:LdapErr:DSID-0C090446,注释:AcceptSecurityContext 错误,数据 52e,v2580 - 使用 Spring 工具

[英]LDAP: error code 49 - 80090308: LdapErr: DSID-0C090446, comment: AcceptSecurityContext error, data 52e, v2580 - using Spring tools

您好,我正在使用以下代码对托管在 Tomcat 上的 spring 工具中的应用程序进行身份验证。

这是我正在运行的代码:

package com.pp.portal;

import java.io.File;
import java.io.InputStream;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.util.FileCopyUtils;

@Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    
    @Override
      protected void configure(HttpSecurity http) throws Exception {
        http
          .authorizeRequests()
            .anyRequest().fullyAuthenticated()
            .and()
          .formLogin();
      }

      @Override
      public void configure(AuthenticationManagerBuilder auth) throws Exception {
          File jks = File.createTempFile("cacerts", "jks");
            jks.deleteOnExit();
            
            try (InputStream fromJks = WebSecurityConfig.class.getResource("/cacerts.jks").openStream()) {
                FileCopyUtils.copy(FileCopyUtils.copyToByteArray(fromJks), jks);
            }
     
            System.setProperty("javax.net.ssl.trustStore", jks.getPath());
            System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
          
            auth
            .ldapAuthentication()
                .userSearchFilter("&(sAMAccountName={0})(memberOf=CN=SG_LoginHistoryApp_Operators,OU=Security*Groups*-*NEW,OU=Secured*Groups,OU=Administration,DC=Domain,DC=uk,DC=dc)")
                .contextSource()
                    .url("ldaps://ldapserver.domain.uk.dc:636")
                    .managerDn("CN=ldap,OU=Accounts,OU=Users,OU=Adapt,DC=Domain,DC=uk,DC=dc")
                    .managerPassword("mangerPassword"); 

      }
     

}

这是我回来的错误:

[LDAP: error code 49 - 80090308: LdapErr: DSID-0C090446, comment: AcceptSecurityContext error, data 52e, v2580]; nested exception is javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C090446, comment: AcceptSecurityContext error, data 52e, v2580]

我正在寻找有关如何解决此问题的建议,所使用的凭据对于我用于登录的用户和正在使用的帐户都是正确的。

我有同样的问题和错误代码。

在我的例子中,用户的密码不再有效。 有一个选项可以让密码在 x 天后失效。 你检查了吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM