在 Java 中模拟 LDAP (APacheDS) 中的用户
我正在 Java 中使用 LDAP (ApacheDS),我想知道是否可以使用系统帐户来模拟用户。 更具体地说,我在 LDAP 目录中有不同的组,并且我需要允许用户修改组下的条目,但仅限该特定用户所属的组。例如,如果有以下组:
o=acme
以及该组的管理员:
cn=admin,o=acme
我想使用系统帐户凭据模拟管理员用户,并允许他们仅在 acme 组中进行更改。
由于上面的内容还不够清楚,我将详细说明:
假设用户 A 登录。他是 ou=Group A 的管理员。如果在登录后的某个时间,他执行了需要连接到 LDAP 的操作,则意味着他的凭据应该存储在会话中以允许他进行连接。我想避免这种情况,并使用系统/其他一些管理员帐户模拟用户 A,而不需要用户 A 密码。
先感谢您。
I'm working with LDAP (ApacheDS) in Java, I was wondering if it's possible to impersonate a user using the system account.
More specifically, I have different groups in LDAP directory, and I need to allow users to modify entries under a group, but only the group this particular user belongs to. For example, if there is a following group:
o=acme
And an administrator of that group:
cn=admin,o=acme
I want to impersonate the admin user using the system account credentials, and allow them to only make changes in acme group.
I will elaborate since the above is not clear enough:
Lets say user A logs in. He is an administrator of ou=Group A. If, some time after logging in, he performs an action that require a connection to LDAP, it means that his credentials should be stored in session to allow him to connect. I want to avoid that, and impersonate user A using the system/some other admin account without needing user A password.
Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么?只需创建您自己的管理应用程序帐户以供应用程序使用,并具有与用户管理帐户相同的权限。不要使用系统帐户,该帐户供 LDAP 本身使用。
Why? Just create your own admin-app account for use by the application, with the same privileges as the user admin account. Don't use the system account, that's for use by LDAP itself.