具有 JDBC 和 JNDI REALM 身份验证的旧应用程序
我的应用程序当前依赖于 JDBC 领域身份验证。最近的需求迫使我们也考虑使用 LDAP 身份验证。我们正在考虑使用 Active Directory 进行身份验证和授权(角色)。作为独立测试,我能够使用 AD 验证我的应用程序。但这是我未来的困惑。
如果用户在登录时选择 LDAP 身份验证,我会使用 AD 对用户进行身份验证,获取用户的角色,然后在我的数据库中复制(创建新的)Windows 用户吗?我必须在数据库中拥有用户,因为应用程序的许多部分旨在从数据库中检索用户。
如果用户选择本地登录,我仍然应该在某个地方使用 JDBCRealm 来对用户进行身份验证。 tomcat中可以有多个领域吗? (我知道这是可能的,但还没有看到太多相关文档)
任何想法、评论、建议都会对我有很大帮助
谢谢 K
My application currently relies on JDBC realm authentication. Recent needs have forced us to think about having LDAP authentication as well. We are thinking about using Active Directory for both authentication as well as authorization (roles). As a standalone test, I was able to authenticate my application with AD. But here is the confusion I have going forward.
If the user chooses LDAP authentication when he logs in, I authenticate the user with AD, get the user's roles and do I replicate(create a new) windows user in my database?. I have to have the user in the database, because many parts of the application is designed to retrieve the user from database
If the users chooses local login, I still should have JDBCRealm somewhere that I should use to authenticate the user. Is it possible to have multiple realms in tomcat? (I sort of know it is possible, but havent seen much documentation around it)
Any thoughts, comments, suggestions would immensely help me
Thanks
K
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您可以在 Tomcat 6 上运行您的应用程序,则有一个名为 CombinedRealm 的领域,它可以让您执行您想要执行的操作: http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#CombinedRealm。在旧版本中可以做你想做的事情,但这确实很痛苦。您基本上必须实现自己的自定义领域。我还没有使用过这个新的CombinedRealm,但如果它像宣传的那样工作,它将为您节省大量的精力和痛苦。相信我。
If you can run your app on Tomcat 6, there is a realm called CombinedRealm that will let you do what you are trying to do: http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#CombinedRealm. It is possible to do what you want in older versions but it's a real pain. You basically will have to implement your own custom Realm. I've not yet used this new CombinedRealm, but if it works as advertised it will save you a lot of effort and pain. Trust me.