具有 LDAP 密码策略的 JAAS
用户正在使用 JAAS(在 Glassfish 2.1 上)访问受限制的 Web 应用程序。使用 LDAPRealm,并从 LDAP 成功执行身份验证。应为用户安装密码策略,以便强制他们更改密码、具有一定复杂性/长度的密码、密码失败以及应检查最后N个密码。使用的 LDAP 服务器(OpenDS)的密码策略支持所有这些,但是在我们使用的 JAAS FORM 登录中如何接收此类信息并不明显,以便可以将信息(即“请更改密码”)显示给用户。
您对如何实施这个有什么想法吗?仅使用数据库不是一个选项,用户需要位于 LDAP 中。不明显的是是否使用 LDAP 密码策略,或者将其全部编程在我们的 Web 应用程序中。我想避免这种情况并使用 LDAP 的本机密码策略。
感谢您的回答和最诚挚的问候, 博佐
A user is accessing a restricted web application with JAAS (on Glassfish 2.1). LDAPRealm is used, and authentication is successfully performed from LDAP. A password policy should be installed for the users, so that they are forced to change passwords, have passwords of certain complexity/length, password failures and last N passwords should be checked. Password policy of LDAP server used (OpenDS) supports all this, but it is not obvious at all how to receive this kind of information in JAAS FORM login we are using, so that the information (i.e. "Please change you password") can be displayed to the user.
Do you have any ideas how to go about implementing this? Using database only is not an option, users need to be in LDAP. What is not obvious is whether to use LDAP password policies at all, or have it all programmed in our web application. I would like to avoid this and use LDAP's native password policies.
Thank you for answers and best regards,
Bozo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,您可以使用 JAAS 执行的操作仅限于任何登录系统都可以支持的一小组操作。虽然 LDAP 支持密码策略,但其他登录系统(例如密钥库)可能不支持,因此 JAAS 无法拥有需要此策略的代码。
因此,您必须使用 JNDI 或可能使用 此库直接与 LDAP 服务器对话来自 Novell。
Unfortunately, what you can do using JAAS is kind of constrained to a small set of operations that any login system can support. While LDAP supports a password policy, other login systems (eg keystores) may not, so JAAS cannot have code that requires this.
Hence, you'll have to talk to the LDAP server directly using either JNDI or possibly this library from Novell.
知道了。必须使用 SAM,因为在 Glassfish 的现有身份验证机制中您无法收到 LoginException(由于登录失败)。
答案在这里:如何覆盖 glassfish 中的 j_security_check?
Got it. Have to use a SAM, since you cannot receive LoginException (with reason of login failure) in the existing auth mechanisms in Glassfish.
Answer is here: How to override j_security_check in glassfish?