- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在将 LDAP 身份验证添加到 spring-boot 应用程序中。所有设置均已相应设置,即使在提供正确的凭据后,我仍收到“LDAP 错误代码 49 AcceptSecurityContext 错误数据 52e v2580”错误。
我正在使用import javax.naming.Context;
并提到了下面的代码。
String url = ldap_url;
String domain = ldap_domain;
String uname = request.getUsername();
String pwd = request.getPassword();
boolean authentication = false;
boolean error = true;
String msg;
String ldapSearchBase = "OU=TEST_OU, DC=DC2, DC=DC1";
// create env for initial context
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, url);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "CN=" + uname + "@" + domain + "," + ldapSearchBase);
env.put(Context.SECURITY_CREDENTIALS, pwd);
NamingEnumeration results = null;
try {
LdapContext ctx = new InitialLdapContext(env, null);
authentication = true;
error = false;
} catch (NamingException e) {
logger.error("LDAP error for :{NamingException}" + e);
return ResponseEntity.ok(new ApiResponse(true, e.getMessage()));
} finally {
if (!error) {
msg = "Login success!!!";
} else {
msg = "Authentication failed!";
}
}
logger.info("exitinig...");
if (authentication) {
return ResponseEntity.ok(new ApiResponse(false, msg));
} else {
return ResponseEntity.ok(new ApiResponse(true, msg));
}
错误被捕获为 NamingException
。
最佳答案
LDAP 错误 code 49 ... data 52e 的错误响应“当用户名有效但密码/凭据无效时返回。”
可能存在基础设施问题,例如 when the domain controller computer account may not be synchronized with the Key Distribution Center (KDC) 。但是,当这种情况存在时,您可能会遇到更多其他问题。
关于java - 即使使用正确的凭据,LDAP 错误代码 49 AcceptSecurityContext 错误数据 52e v2580,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58391319/
我正在尝试在基于 http.sys 的服务器(使用 IOCP)中实现单点登录,但我遇到了 AcceptSecurityContext 的奇怪问题,它会随机失败并返回 SEC_E_LOGON_DENIE
我有一个简单的 HTTP 服务器,它使用协商协议(protocol)对客户端进行身份验证。它使用 SSPI 调用来获取服务器凭据并建立安全上下文。服务器在域中并代表域用户运行。一切正常,如果我以控制台
我有问题 。这是我使用 ldap 进行身份验证的代码 在 Spring ,但它有错误告诉我 AcceptSecurityContext。 javax.naming.AuthenticationExce
这是设置。在 ASP.Net 站点上,我们希望在特定页面上进行 NTLM 身份验证。这将工作的方式是将有一个模块只响应那些页面,然后执行 NTLM 身份验证所需的来回请求/响应。 NTLM 并不是那么
我正在将 LDAP 身份验证添加到 spring-boot 应用程序中。所有设置均已相应设置,即使在提供正确的凭据后,我仍收到“LDAP 错误代码 49 AcceptSecurityContext 错
我使用 Java 的 LdapContext 向一台 AD 服务器进行身份验证。它在Windows7家庭普通版、企业版、专业版上运行良好。但是当客户端在Windows7旗舰版和Vista旗舰版上运行时
LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 5
LDAP: error code 49 - 80090308: LdapErr: DSID-0C09042F, comment: AcceptSecurityContext error, data 5
LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 5
我在日志中收到以下错误。尽管我们提供了正确的用户名和密码来登录网站。 LDAP 出现此错误。 : [LDAP: error code 49 - 80090308: LdapErr: DSID-0C09
我是一名优秀的程序员,十分优秀!