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

查看:42
本文介绍了如何在 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天全站免登陆