【问题标题】:Shiro Configuration - roles and limiting searchbaseShiro 配置 - 角色和限制搜索库
【发布时间】:2018-12-16 19:17:01
【问题描述】:

我们一直在尝试添加正确的 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)

相关帖子:

有什么想法会出错吗?

谢谢, 安德拉斯

【问题讨论】:

    标签: configuration active-directory shiro apache-zeppelin


    【解决方案1】:

    迟到总比没有好) 使用 LdapRealm 获得角色组映射。需要设置

    ldapRealm.userSearchAttributeName = userPrincipalName
    
    ldapRealm.memberAttribute = member
    

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

    【讨论】:

      猜你喜欢
      • 2011-08-21
      • 2012-12-25
      • 2013-10-31
      • 2011-11-26
      • 2013-09-14
      • 2012-08-27
      • 2016-09-28
      • 1970-01-01
      • 2013-07-27
      相关资源
      最近更新 更多