我是 LDAP 新手。我必须使用 Java 中的 Open LDAP 实现用户和角色管理。目前我正在使用开放 LDAP 2.4。我计划将以下必需的实体映射到 LDAP 对象,例如:
用户:通过用户 ID/密码标识的不同用户。我将其与 LDAP 的 inetOrgPerson 对象进行映射。
组:这将是用户组。我将其与 ldap 中的 organzationalUnit 进行映射。
角色:角色可以是一组权限。我正在将其映射到 groupOfNames 对象。我尝试过使用organizationalRole,但没有找到任何链接组和用户的方法。有什么办法吗?
权限:“读取”、“写入”等权限。我应该将其映射到哪个对象,以便我可以为角色包含不同的权限,然后将角色与组和用户关联?
所以,我对权限和角色非常困惑,这如何在 LDAP 中映射。另外,这两个角色和权限的 ldif 文件格式应该是什么。 我希望尽可能将所有内容保留在 LDAP 中以进行用户管理,而不是 RDBM。
最佳答案
User: Different users identified by user id/ password. I am mapping it with
inetOrgPerson
object of LDAP.
不错的选择。
Group: it will be group of users. I am mapping it with organzationalUnit in LDAP.
好的,但您还应该查看groupOfUniqueNames
。
Role: roles could be group of permissions.
没有。角色就是角色。该角色拥有什么权限是一个完全独立的问题,根本不一定属于 LDAP。
I am mapping this with groupOfNames object. I have tried with
organizationalRole,
but didn't find any way to link groups and users.
organizationalRole
有 roleOccupant
,这就是您所需要的。
Permission: permissions like 'READ', 'WRITE' etc. To which object I should map this so that I can include different permission to a Role and then associate role to groups and users?
见上文。我根本不相信这属于 LDAP,至少我从未找到映射它的方法。我通过 web.xml 的安全功能来实现这一点。
Also, What should be the ldif file format for these two, Roles and permissions.
LDIF 格式直接不属于您使用的objectClass
。映射很简单。
关于java - 使用 LDAP 在 java 中进行用户和角色管理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29648639/