[英]LDAP: error code 49 - 80090308: LdapErr: DSID-0C09044E, comment: AcceptSecurityContext error, data 52e, v2580 (first time using ldap)
I am having problem with ldap on spring, I know what that error means but idk what i am doing wrong in the config of the connection我在 spring 上遇到 ldap 问题,我知道那个错误是什么意思,但我知道我在连接配置中做错了什么
this is my application.properties:这是我的应用程序。属性:
spring.ldap.urls=ldap://***
spring.ldap.base=OU=Account,DC=company,DC=lan
spring.ldap.username=CN=Intranet company
spring.ldap.password=pswd
The password are good and username too but maybe my base is false?密码和用户名都很好,但也许我的基础是假的? can anyone help me plz?谁能帮我吗?
and here is what i try to do这是我尝试做的
@Autowired
private LdapTemplate ldapTemplate;
System.out.println( ldapTemplate.search(
"OU=Account,DC=company,DC=lan",
"cn=" + account.username ,
(AttributesMapper<String>) attrs -> (String) attrs.get("sAMAccountName").get()));
I just try to connect to the active directory and discover how it works我只是尝试连接到活动目录并发现它是如何工作的
The error message makes it clear that you're using Active Directory.错误消息清楚地表明您正在使用 Active Directory。 So I'm pretty sure this is the problem:所以我很确定这是问题所在:
spring.ldap.username=CN=Intranet company
I don't think Active Directory likes that format for the username.我认为 Active Directory 不喜欢这种用户名格式。 It either has to be:它要么必须是:
CN=Intranet company,OU=Account,DC=company,DC=lan
), or完整的 DN ( CN=Intranet company,OU=Account,DC=company,DC=lan
),或者sAMAccountName
attribute), or普通用户名( sAMAccountName
属性),或DOMAIN\username
if the user is not on the domain you're connecting to, or DOMAIN\username
如果用户不在您要连接的域中,或者userPrincipalName
(eg username@company.lan
). userPrincipalName
(例如username@company.lan
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.