四郎配置 - 角色和限制搜索库



我们一直在尝试添加正确的 shiro 配置,以确保特定的 AD 组只能登录,并区分角色。我们得到了两个有效的解决方案,但是第一个让活动目录中的每个人(但角色工作正常(,第二个不允许每个人进入,但角色不起作用。

1( 此版本适用于向特定 CN 添加角色,但允许所有人登录。

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

2( 此版本将登录名限制为指定的 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)

相关文章:

  • https://community.hortonworks.com/questions/54896/zeppelin-ad-users-not-binded-to-groups.html
  • https://community.hortonworks.com/questions/82135/how-to-limit-access-to-zeppelin-webui-based-for-sp.html

有什么想法我们出错了吗?

谢谢 安德拉斯

迟到总比没有好( 使用LdapRealm进行角色组映射。需要设置

ldapRealm.userSearchAttributeName = userPrincipalName
ldapRealm.memberAttribute = member

在我们的例子中,userPrincipalName 是 AD 中的属性,其中包含我们输入的完整用户名 (user@domain.com(,成员是存储组成员的属性。

最新更新