Configuration Shiro配置-角色和限制searchbase

Configuration Shiro配置-角色和限制searchbase,configuration,active-directory,shiro,apache-zeppelin,Configuration,Active Directory,Shiro,Apache Zeppelin,我们一直在尝试添加正确的shiro配置,以确保特定的广告组只能登录,并区分角色。我们有两个可行的解决方案,但是第一个让我们加入active directory中的所有人(但是角色可以正常工作),第二个不允许加入所有人,但是角色不起作用 (一) 此版本适用于向特定CNs添加角色,但允许每个人登录 activeDirectoryRealm = org.apache.zeppelin.realm.ActiveDirectoryGroupRealm activeDirectoryRealm.system

我们一直在尝试添加正确的shiro配置,以确保特定的广告组只能登录,并区分角色。我们有两个可行的解决方案,但是第一个让我们加入active directory中的所有人(但是角色可以正常工作),第二个不允许加入所有人,但是角色不起作用

(一) 此版本适用于向特定CNs添加角色,但允许每个人登录

activeDirectoryRealm = org.apache.zeppelin.realm.ActiveDirectoryGroupRealm
activeDirectoryRealm.systemUsername = aduser
activeDirectoryRealm.hadoopSecurityCredentialPath = jceks://file/user/zeppelin/conf/zeppelin.jceks
activeDirectoryRealm.searchBase = OU=User Accounts,DC=domain,DC=local
activeDirectoryRealm.url = ldap://AD.domain.local:389
activeDirectoryRealm.groupRolesMap = "CN=admins,OU=User Accounts,DC=domain,DC=local":"admin"
activeDirectoryRealm.authorizationCachingEnabled = false
activeDirectoryRealm.principalSuffix = @domain.local
securityManager.realms = $activeDirectoryRealm
(二) 此版本限制登录到指定的AD组,但不将角色与该组关联

ldapADGCRealm = org.apache.zeppelin.realm.LdapRealm
ldapADGCRealm.contextFactory.systemUsername = aduser@domain.local
ldapADGCRealm.hadoopSecurityCredentialPath = jceks://file/user/zeppelin/conf/zeppelinldap.jceks
ldapADGCRealm.searchBase = "OU=User Accounts,DC=domain,DC=local"
ldapADGCRealm.userSearchBase = "OU=User Accounts,DC=domain,DC=local"
ldapADGCRealm.groupSearchBase = "OU=User Accounts,DC=domain,DC=local"
ldapADGCRealm.groupObjectClass = group
ldapADGCRealm.memberAttribute = memberUid
ldapADGCRealm.groupIdAttribute = cn
ldapADGCRealm.groupSearchEnableMatchingRuleInChain = true
ldapADGCRealm.rolesByGroup = users: admin
ldapADGCRealm.userSearchFilter = (&(objectclass=user)(sAMAccountName={0})(memberOf=CN=users,OU=User Accounts,DC=domain,DC=local))
ldapADGCRealm.contextFactory.url = ldap://AD.domain.local:389 (edited)
相关职位:

知道我们哪里出错了吗

谢谢, 安德拉斯(迟做总比不做好) 使用LdapRealm使角色组映射工作正常。需要设置

ldapRealm.userSearchAttributeName = userPrincipalName

ldapRealm.memberAttribute = member
在本例中,userPrincipalName是AD中包含我们输入的完整用户名的属性(user@domain.com)成员是存储组成员的属性