春天LDAP身份验证失败的错误codeS [英] Spring ldap authentication failed error codes
问题描述
我使用Spring LDAP(1.3.1)交谈ADAM和Active Directory。
I'm using Spring LDAP (1.3.1) to talk to ADAM and Active Directory.
当我尝试验证有人利用ldapTemplate.authenticate()我回到通过错误回调错误,但它给出了一个非常通用的异常的AuthenticationException,我不能提取究竟是什么问题:
When I try to authenticate someone using ldapTemplate.authenticate() I get back errors via the error callback, but it gives a very generic exception AuthenticationException and I cannot extract what exactly is the problem:
- 帐号停用
- 在密码过期
- 必须更改密码在下次登录
- 帐户过期
- 等
我所得到的回复是一个detailMessage我以为是公元发回。是这样的:
All I get back is a detailMessage which I assume is what AD sends back. Something like:
org.springframework.ldap.AuthenticationException: [LDAP:错误code 49 - 8009030C: LdapErr:DSID-0C0903A9,评论: AcceptSecurityContext错误,数据773, v1db0
org.springframework.ldap.AuthenticationException: [LDAP: error code 49 - 8009030C: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 773, v1db0
我可以看到数据 773
,这意味着用户下次登录时须更改密码。我不想手动解析这一点。是否有任何适配器我不知道呢?
I can see data 773
, which means the user must change the password at next login. I don't want to parse this manually. Are there any "adapters" I am not aware of?
有没有人有这个问题?
非常感谢!
推荐答案
此链接列出如何LDAP错误codeS地图JNDI例外。看着春LDAP code,看来春天每个JNDI例外映射到其自定义的LDAP异常( LdapUtils.convertLdapException()
)
This link lists how ldap error codes map to JNDI Exceptions. Looking at spring ldap code, it appears that spring maps each JNDI exception to its custom LDAP exception (LdapUtils.convertLdapException()
)
现在, 773
似乎specfic到Active Directory。因此,这需要由用户显式地处理,如果需要的话。 此链接列出一大堆的Active Directory错误。春天LDAP将其错误的详细信息提供这段文字,让用户使用它们为宜。
Now, 773
seems specfic to Active Directory. Hence this needs to be handled by user explicitly, if required. This link lists a bunch of Active Directory errors. Spring ldap would provide this text in its error details, leaving the user to use them as suitable.
这篇关于春天LDAP身份验证失败的错误codeS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!