簡體   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