如何在Java中读取LDAP密码策略 [英] How to read LDAP password policy in Java

查看:168
本文介绍了如何在Java中读取LDAP密码策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以从LDAP读取用户密码策略,比如它何时到期或更多详细信息,如密码强度(最小长度等)?我需要这些信息,因此我可以为保存在我的数据库中的用户使用相同的策略。我的java应用程序要求数据库中的用户必须与域同​​步。

Can i read user password policy from LDAP, like when it expires or more details like password strength (minimal length etc.) ? I need these information so I can use the same policy for users kept in my database. My java application require that users from the database have to be synchronized with domain.

推荐答案

如果你想获得密码策略LDAP查询尝试此

If you want to get the password policy through LDAP queries try this

当前域中没有PSO政策

without PSO policy in your current domain

String searchDomain= "DC=company,DC=ORG";
String ldapQuery = "(&(objectClass=domainDNS))";
String ldapAttribute = "maxPwdAge";

如果您使用PSO政策,请尝试此代码

If you use a PSO policy try this code

String domainLookupString = "CN=UsersPSO,CN=Password Settings Container,CN=System,DC=company,DC=ORG";
String ldapFilterString = "(&(objectClass=msDS-PasswordSettings))";
String ldapAttribute = "msDS-MaximumPasswordAge"

这篇关于如何在Java中读取LDAP密码策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆