在 Java CAPS 中使用 LDAP

配置 Enterprise Manager Server

配置 LDAP 服务器后,可配置 Enterprise Manager Server,使其可以找到 LDAP 服务器,并查找相应的信息。

必须编辑以下 Enterprise Manager 文件:web.xmlldap.properties

Procedure配置 Enterprise Manager Server

  1. 关闭 Enterprise Manager 的服务器组件。

  2. 打开 web.xml 文件,该文件位于 JavaCAPS-install-dir/emanager/server/webapps/sentinel/WEB-INF 目录中。

  3. 找到以下行:


    <param-name>com.stc.emanager.sentinel.authHandler</param-name>
    <param-value>com.stc.cas.auth.provider.tomcat.TomcatPasswordHandler</param-value>
  4. 将参数值更改为:


    <param-value>com.stc.cas.auth.provider.ldap.LDAPHandler</param-value>
  5. 保存 web.xml 文件

  6. 打开 ldap.properties 文件,该文件位于 JavaCAPS-install-dir/emanager/server/webapps/sentinel/WEB-INF/classes 目录中。

  7. 下表介绍了 ldap.properties 文件中出现的所有属性。针对您的 LDAP 服务器编辑该部分中的属性,并确保未注释掉这些属性。

    属性 

    描述 

    com.stc.sentinel.auth.ldap.serverType 

    LDAP 服务器的类型。 

    com.stc.sentinel.auth.ldap.serverUrl 

    LDAP 服务器的 URL。 

    com.stc.sentinel.auth.ldap.searchFilter 

    用户条目中用户 ID 属性的名称。 

    com.stc.sentinel.auth.ldap.searchBase 

    Enterprise Manager 将在其中搜索用户的 LDAP 目录部分的根条目。 

    com.stc.sentinel.auth.ldap.searchScope 

    当前未使用此属性。 

    com.stc.sentinel.auth.ldap.bindDN 

    用于连接 LDAP 服务器的安全主体。 

    com.stc.sentinel.auth.ldap.bindPassword 

    安全主体的密码。 

    com.stc.sentinel.auth.ldap.referral 

    LDAP 引用策略。默认值为 follow,表示将自动执行 LDAP 引用。请注意,必须在 LDAP 服务器中启用引用。其他有效值为 throw(对于引用异常)和 ignore

    此属性为可选属性。 

    此属性仅出现在 Active Directory 和 OpenLDAP 属性集中。 

    com.stc.sentinel.auth.ldap.roleAttribute 

    用户条目中角色名称属性的名称。 

    com.stc.sentinel.auth.ldap.roleBaseDN 

    Enterprise Manager 将在其中搜索角色的 LDAP 目录部分的根条目。 

    此属性仅出现在 OpenLDAP 属性集中。 

    com.stc.sentinel.auth.ldap.rolePattern 

    使用此属性可以为角色名称配置模式匹配。在 LDAP 目录中,您可以将 Enterprise Manager 用户放置在与其他用户不同的单独业务范围中。 

    此属性仅出现在 Active Directory 属性集中。 

  8. 保存 ldap.properties 文件。

  9. 启动 Enterprise Manager 的服务器组件。