IBM®
跳转到主要内容
    中国 [选择]    使用条款
 
 
Select a scope:Search for:    
    首页    产品    服务与解决方案     支持与下载    个性化服务    
跳转到主要内容

developerWorks 中国  >  WebSphere  >

使用 Tivoli Access Manager 为 WebSphere Portal 4.1 启用认证和授权

developerWorks
文档选项

未显示需要 JavaScript 的文档选项


级别: 初级

Paul Kelsey (pkelsey@us.ibm.com), 顾问软件工程师, IBM WebSphere Portal 小组

2002 年 11 月 16 日

IBM WebSphere Portal 支持用外部认证和授权引擎(比如 Tivoli Access Manager)为门户引擎作出安全性方面的决定。本文讨论了安全性概念,一步步配置了 Tivoli Access Manager 和 Portal,并通过提供示范案例演示了运行时操作。

© Copyright International Business Machines Corporation 2002. All rights reserved.

介绍

IBM® WebSphere® Portal 4.1(以下称为 Portal)支持用外部认证和授权引擎(比如 Tivoli® Access Manager)为门户引擎作出安全性方面的决定。在本文中,我介绍了安全性概念,一步步配置了 Tivoli Access Manager 和 Portal,并通过提供示范案例说明了运行时操作。

在使用 Portal 时,您需要考虑两个主要的安全性概念:认证和授权。一个会话通常只发生一次认证决定,而授权决定在整个门户会话期间会发生多次。将 Access Manager 和 Portal 集成在一起时,您可以允许 Tivoli Access Manager 只作认证决定、只作授权决定或者作这两方面的决定。





回页首


认证与授权

理解认证与授权之间的差异非常重要。认证解决类似“您是谁?”以及“我怎样知道您所说的自己的身份是不是真的?” 这样的问题。授权解决类似“您可以对对象 X 执行什么样的操作?”以及“您可以编辑门户欢迎页面吗?”这样的问题。

出于本文的目的,我们将用“基本(BASIC)”认证来解决认证问题(参见图 1)。用户将提供用户标识和密码;用户标识指出用户是谁,密码用来验证用户。在我们的案例中,Tivoli Access Manager 信任关联拦截器(Tivoli Access Manager Trust Association Interceptor)将负责提示用户输入用户标识和密码,并负责认证。


图 1. TAI 提示输入用户标识和密码
Enter Network Password 对话框的抓屏

通过 TAI 认证了用户的身份后,用户进行门户会话时就会出现授权请求。





回页首


先决条件

本文中的示例假定您已安装了下列软件:

  • DB2 7.2 修订包 5
  • WebSphere Application Server 高级版 4.02
  • IBM HTTP Server 1.3.19 和 IBM Secureway 3.2.2,使用 o=ibm , c=us 作为后缀
  • 带修订包 3 的 WebSphere Portal 4.1
  • 正确配置的 Tivoli Access Manager for e-business 3.9。 注意:您可以使用命令行界面或 Web Portal Manager 管理 Tivoli Access Manager。在本文中,我将使用命令行界面。

尽管 Tivoli Access Manager 提供了认证,但为使配置能正确发挥作用,Tivoli Access Manager 和 Portal 必须共享 LDAP 名称空间。因为 Tivoli Access Manager 保护 LDAP 名称空间,您可能不得不在 WebSphere Application Server Security Console 中设置 Bind Distinguished Name ,以让 WebSphere Application Server 和 Portal 访问它。 注意:我用 cn=root 和相应的密码设置了我的 Bind Distinguished Name





回页首


使用信任关联拦截器进行的认证

信任联合拦截器(TAI)对 Portal 安装来说不是唯一的。它们为第三方认证引擎(比如 Tivoli Access Manager webSEAL)提供了一种一般的方法,将它们已经收集到的凭证传递到 WebSphere Application Server。本文演示了如何使用 TAI 为 Portal 执行认证,但请注意,同样的 TAI 还可以保护另一个应用程序服务器。

Portal 支持 Tivoli Access Manager 的 TAI,但您也可以编写自己的 TAI。关于为 WebSphere Application Server 4.0 编写自己的 TAI 的更多信息,请参阅 http://ibm.com/software/webservers/appserv/doc/v40/aee/wasa_content/050603.html

配置 Tivoli Access Manager

建立 webSEAL 联结(junction)

一个联结就是 Tivoli Access Manager webSEAL 的一个组件,它使管理员能够以 URI 的形式定义到一个明确的 Web 应用程序的入口点。例如,我可以把一个联结点定义为联系 hostA.ibm.com/myApp/myApplicationA ,把另一个联结定义为联系 hostB.ibm.com/myApplicationB

要使用 Tivoli Access Manager 作为认证点,您必须让 Tivoli Access Manager 的 webSEAL 组件拦截发往门户的请求,提示用户输入用户标识和密码,并允许或拒绝对门户的访问。

pdadmin 命令行可以创建联结,还可以对其进行查看、修改等操作。在创建要与 Portal 一起使用的联结时,需要下列参数:

  • 传输(-t)在本文中,我们将创建一个从 webSEAL 到 IBM HTTP Server(IHS)的 TCPIP 联结。您可以创建一个 SSL 联结,但需要 server task create 命令的更多命令行参数。请参阅“webSEAL 管理员指南”(webSEAL Administrator's Guide)了解更多信息。

  • 主机(-h)在本文中,IHS/Portal 驻留所在的主机名是 paetyndog.raleigh.ibm.com

  • 端口(-p)缺省情况下,webSEAL 与 IBM HTTP Server 一样,侦听端口 80。在本文中,所有的应用程序都驻留在同一台机器上,但这两个进程发生了冲突。合适的解决方案是更改 IBM HTTP Server 的端口。在本文中,我们使用端口号 6025。为此,我们象下面这样修改:

    <ihs_root>\conf\httpd.conf
    #Port 80
    Port 6025


    在更改 Web 服务器的端口时,您还需要修改 WebSphere Application Server Administrative Console 中的 default_host Virtual Hosts 定义,使用端口号 *:6025 响应请求。

  • 凭证(-c)TAI 信任 webSEAL 介绍的 iv-user 头,所以我们的联结应该向 Portal 传送凭证头。

  • 联结点(/)Web 空间的根 URI(或者说 / )就是要创建的最简单的联结。它会使用户刚点击一下 webSEAL 的主页就看到提示,但这却是速度最快的启动和运行方法。我们可以创建其它的联结点,也可以远程配置,但必须相应地修改 Portal 配置。请参阅 <was_root>\lib\app\config\services\ConfigService.properties 了解 Portal 操作的 URI、主机名和端口选项。
  • 强制(-f)因为我们要覆盖在 / 处建立的缺省 webSEAL 联结,所以需要使用 -f 强制 pdadmin 覆盖它。注意:使用 -f 选项时,webSEAL 不再检查服务器是否正在侦听指定的端口。

记住这些配置值,输入这个命令来创建联结:

pdadmin> server task webseald-paetyndog create -t tcp -h 
          
paetyndog.raleigh.ibm.com -p 6025 -c all -f /

注意:尽管这条命令在本文档中出现在两行上,但应该将它输入在一行上。

创建用户

Portal 提供了三种创建新用户的方法。其中两种是在门户运行时期间处理的:

  • 自注册允许匿名用户为门户创建新的用户帐户
  • User/Group Manager Portlet 允许 Portal 管理员创建新的用户帐户

第三种方法是在安装 WebSphere Portal 前执行:将包含管理用户的 LDAP 数据交换格式(LDAP Data Interchange Format,LDIF)文件直接导入 LDAP 目录。

在把 Tivoli Access Manager 用作外部安全管理器(External Security Manager)时,通过 WebSphere Portal 或通过 LDIF 导入创建用户可能会引起问题。如果您正在通过使用 Portal 注册页面或 portlet,或者通过导入缺省的 Portal LDIF 添加用户,那么 Tivoli Access Manager 将无法识别添加的用户。在这些情况下,要注意:

  • 创建一个新用户而不授予他适当的权限可能会违反公司的方针
  • Tivoli Access Manager 登录模块(请参阅 portallogin.config )无法在登录时认证 Portal 创建的用户和组。用户的登录尝试将失败

要把一个已有的用户导入 Tivoli Access Manager(例如, wpsadminwpsbind ),请在 Tivoli Access Manager 命令行输入下列内容:

pdadmin> user import wpsadmin uid=wpsadmin,cn=users,o=IBM,c=us
             pdadmin> user modify wpsadmin account-valid yes 

假设在 Tivoli Access Manager 环境中创建用户这项工作将通过 WebSphere Portal 外部的供应过程完成。那么,在这个环境中应该禁用 Portal 的创建用户功能。为确保不通过 Portal 界面创建用户,请执行下面的操作:

要禁用 Portal 的自动注册功能,请编辑 <twps_root>\app\wps.ear\wps.war\themes\html\Banner.jsp ,并编辑位于每个主题(theme)的子目录中的 Banner.jsp ,让其注释掉登记按钮:

<%--

<%-- enroll button --%>
          
<wps:if loggedIn="no">
<td valign="middle">
<a href='<wps:url command="PrepareEnrollment" home="public" reqid="no"/>'>
<img src='<wps:urlFindInTheme file="nav_create_account.gif"/>' alt='
<wps:text key="link.enrollment" bundle="nls.engine"/>
' border="0" align="absmiddle" width="26" height="25" title='
<wps:text key="link.enrollment" bundle="nls.engine"/>'></a>
</td>
</wps:if>

 --%>

要禁用用户的 User Manager portlet 操作,请编辑 <was_root>\installedApps\UsersManager_WPS_<;portlet Application ID>;\UsersManager.war\WEB-INF\jsp\UserManagement.jsp ,并注释掉带有创建、编辑和删除用户选项的部分。例如,在 D:\WebSphere\AppServer\installedApps\UsersManager_WPS_PA_115.ear\UsersManager.war\WEB-INF\jsp\UserManagement.jsp 中,象下面这样修改:

....

<%-- //begin code to disable create/edit/delete Users
        
<% if (hasCreatePermission) { %> <TR><TD> <A HREF="#" onclick="return <portletAPI:encodeNamespace value='doSubmit'/>('createUserAction');" style="text-decoration:none;" > <img border="0" align="absmiddle" src=" <portletAPI:encodeURI path='images/add.gif'/>" title="<portletAPI:text bundle='nls.manageuser' key='button.add' />" alt="<portletAPI:text bundle='nls.manageuser' key='button.add' />" /> <span class="wpsDialogIconText" > <portletAPI:text bundle="nls.manageuser" key="button.add" /></span></A> </TD></TR> <% } %> <TR><TD> <A HREF="#" onclick="return <portletAPI:encodeNamespace value='editUser()'/>;" style="text-decoration:none;" > <img border="0" align="absmiddle" src="<portletAPI:encodeURI path='images/edit.gif'/>" title="<portletAPI:text bundle='nls.manageuser' key='button.edit' /> " alt="<portletAPI:text bundle='nls.manageuser' key='button.edit' />" /><span class="wpsDialogIconText" > <portletAPI:text bundle="nls.manageuser" key="button.edit" /> </span> </A> </TD></TR> <TR><TD> <A HREF="#" onclick="return <portletAPI:encodeNamespace value='deleteUser()'/>;" style="text-decoration:none;" > <img border="0" align="absmiddle" src="<portletAPI:encodeURI path='images/delete.gif'/>" title="<portletAPI:text bundle='nls.manageuser' key='button.delete' />" alt=" <portletAPI:text bundle='nls.manageuser' key='button.delete' />" /> <span class="wpsDialogIconText" ><portletAPI:text bundle="nls.manageuser" key="button.delete" /></span> </A> </TD></TR> --%> //end code comment to disable create/edit/delete users

....

配置 WebSphere Application Server 和 Portal

启用 TAI

在 WebSphere Application Server Security Center 中,单击 Authentication选项卡。然后,选择 Enable Web trust association 复选框。这样会启用 TAI。请参见下图 2。


图 2. WebSphere Application Server Security Center Authentication 选项卡视图
WebSphere Application Server Security Center Authentication 选项卡视图的抓屏

这将要求您重新启动管理服务器,但首先您要检查必需的配置文件。

验证配置文件

编辑 <was_root>\properties\trustedservers.properties ,使其包含下列内容:

# Trust Association Properties
# IBM WebSphere Application Server, Version 4.0, 2001

com.ibm.websphere.security.trustassociation.enabled=true

#Use this property to specify the types of reverse proxy
#servers that will be loaded at runtime

com.ibm.websphere.security.trustassociation.types=webseal

#For each type of reverse proxy servers specified in
#com.ibm.websphere.security.trustassociation.types,
#specify the class file that implements the associated
#interceptor for it.

com.ibm.websphere.security.trustassociation.webseal.interceptor=
     com.ibm.ws.security.web.WebSealTrustAssociationInterceptor

#Optionally, specify a properties file for any of the
#reverse proxy servers type specified above. The properties file
#must end with ".properties". e.g. webseal36.properties. However,
#do not include this extension as shown below. Moreover, you can only
#do this if the interceptor class extends WebSphereBaseTrustAssociationInterceptor
#and both init() and cleanup() methods were implemented. The init()
#method should read and parse the contents of the properties file
com.ibm.websphere.security.trustassociation.webseal.config=webseal

确保现有的 <was_root>\properties\webseal.properties 包含下列内容:

#WebSeal Trust Association Interceptor Configuration file
#IBM WebSphere Application WebSphere Version 4.0, 2001
#Uncomment and use this property to specify the header name(s)
#you expect to exist in the HTTP Request 
com.ibm.websphere.security.webseal.id=iv-user,iv-creds 
#Uncomment and use this property to specify where you expect the WebSeal server(s)
#to be.
#com.ibm.websphere.security.webseal.hostnames=vivaldi.raleigh.ibm.com, vivaldi
#Uncomment and use this property to specify the port(s) from which the WebSeal
#server(s) receive user requests
#com.ibm.websphere.security.webseal.ports=444
#For WebSeal 3.71, if basic login (username/password) is used, uncomment and use
#this property to specify the id that the webseal server must use to validate trust 
#with the interceptor
#NOTE: For WebSeal 3.6, Do not uncomment this line 
#com.ibm.websphere.security.webseal.loginId=LoginID
#For mutual SSL (client certificate), uncomment and use this property to specify 
#mutualSSL's value 
com.ibm.websphere.security.webseal.mutualSSL=true 

重新启动服务器

现在,重新启动管理服务器(Administration server)和 Portal 服务器。请注意 <portal_root>\logs\appserver-out.log 文件中的下列消息:

[6/13/02 13:18:54:437 EDT] 5acbe90a TrustAssociat A SECJ0121A: Trust Association Init 
     class com.ibm.ws.security.web.WebSealTrustAssociationInterceptor 
     loaded successfully
[6/13/02 13:18:54:468 EDT] 5acbe90a WebSealTrustA W PD Authentication Disabled
[6/13/02 13:18:54:484 EDT] 5acbe90a TrustAssociat A SECJ0122A: Trust Association Init 
     Interceptor signature: WebSeal Interceptor Version 1.1
[6/13/02 13:18:54:484 EDT] 5acbe90a TrustAssociat A SECJ0120A: Trust Association Init 
     loaded 1 interceptor(s)

测试 TAI

现在,您可以从 pdadmin 命令行创建新的 Portal 用户,或者使用随 Tivoli Access Manager 一起提供的 Web Portal Manager 创建。注意:新用户和组必须是仍然拥有 WebSphere Application Server 专有名称(Distinguished Name,DN),也即 uid=jonsmith , cn=users , o=IBM , c=us

使用 Tivoli Access Manager 添加新用户

pdadmin 命令行输入下列内容(输入在一行上):

pdadmin> user create jonsmith uid=jonsmith,cn=users,o=IBM,c=us "Jon Smith" 
            Smith password12
            

然后输入:

pdadmin> user modify jonsmith account-valid yes

确保 WebSphere Portal 正在运行,打开您的浏览器,并直接转到 http://webseal_hostname/wps/myportal 。WebSEAL 将提示您输入用户标识和密码;请输入 jonsmith/password12 。您将作为用户 Jon Smith 被带到一个新的已认证用户页面:


图 3. 作为用户 Jon Smith 被带到一个新的已认证用户页面
用户 Jon Smith 登录的已认证新用户页面的抓屏




回页首


授权

与使用 TAI 执行认证的过程不同,将授权委托给 Tivoli Access Manager 的过程是特定于 Portal 的。许多门户资源都可以转移到外部安全管理器。尽管您将主要移动 portlet、页面和区域(place),但您仍能够存储关于用户组、资源集合,甚至门户自身的许可权。对门户资源访问的允许、对这些资源的移动都可以在 Portal Administration 的控制下通过现有的 Security 页面严格完成。一旦在外部移动了资源,您就必须使用外部供应商的应用程序管理( Application Management)界面修改许可权。

配置 Tivoli Access Manager

Portal 的授权功能要求管理员配置 Portal 与 Tivoli Access Manager 之间的连接。必须将 PDJRTE(安装 Access Manager 期间的一个可用组件)安装在 WebSphere Application Server/Portal 机器上。这些是基本步骤。如需更多信息,请参考您的 Tivoli Access Manager 文档。

运行 Pdjrtecfg

运行下面的命令来复制必需的 JAR 文件,以使 WebSphere Application Server 连接到 Authorization Server:

<TAM_root>\sbin\pdjrtecfg.bat -action config -java_home <was_root>\Java\jre

例如,您可以(在一行上)输入:

E:\software\pd\sbin\pdjrtecfg.bat -action 
     config Java_home D:\websphere\appserver\Java\jre

运行 SvrSslCfg

运行下面的命令来配置 WebSphere Application Server 和 Tivoli Access Manager 上的一个 SSL 连接。它创建密钥文件(keyfile)和属性文件,稍后在配置 Portal 时将使用这些文件。它还将创建指定为 username 的用户,并将其放到适当的组中:

<was_root>\Java\jre\bin\Java com.tivoli.mts.SvrSslCfg <username>
     <sec_master password> <pdmgrd hostname> <pdacld hostname>

因为我让所有的应用程序都运行在同一台机器上,我将(在一行上)输入:

D:\websphere\appserver\Java\jre\bin\Java com.tivoli.mts.SvrSslCfg wpspd 
     passw0rd paetyndog.raleigh.ibm.com paetyndog.raleigh.ibm.com

创建用户

认证与授权的创建用户步骤是相同的。如果您已用 TAI 配置了认证,那么您就已经完成了这个步骤。如果还没有配置,那么请遵守上面“认证”部分的 创建用户指示。

配置 WebSphere Portal

配置 services.properties

这是其中一个主要的 Portal 配置文件,它定义 Portal 操作中使用的不同服务。请修改 <was_root>\lib\app\config\services.propertiescom.ibm.wps.services.authorization.ExternalAccessControlService 的值:

# Licensed Materials - Property of IBM, 5724-B88, (C) Copyright IBM Corp. 
2001, 2002 - All Rights reserved.
# ------------------------------------------- #
# The List (and Order) of Registered Services #
# ------------------------------------------- #

com.ibm.wps.services.config.ConfigService = 
     com.ibm.wps.services.config.ConfigServiceImpl
com.ibm.wps.services.platform.PlatformService = 
     com.ibm.wps.services.platform.PlatformServiceImpl
com.ibm.wps.services.log.LogService = 
     com.ibm.wps.services.log.LogServiceImpl
com.ibm.wps.services.localizer.LocalizerService = 
     com.ibm.wps.services.localizer.LocalizerServiceImpl
com.ibm.wps.services.naming.NamingService = 
     com.ibm.wps.services.naming.NamingServiceImpl
com.ibm.wps.services.finder.FinderService = 
     com.ibm.wps.services.finder.FinderServiceImpl
com.ibm.wps.services.loader.LoaderService = 
     com.ibm.wps.services.loader.LoaderServiceImpl
com.ibm.wps.services.template.TemplateService = 
     com.ibm.wps.services.template.TemplateServiceImpl
com.ibm.wps.services.datastore.DataStoreService =
     com.ibm.wps.services.datastore.DataStoreServiceImpl
com.ibm.wps.services.authorization.AccessControlService = 
     com.ibm.wps.services.authorization.AccessControlImpl
        com.ibm.wps.services.authorization.ExternalAccessControlService = 
     com.ibm.wps.services.authorization.PDExternalAccessControlImpl
com.ibm.wps.services.registry.RegistryService = 
     com.ibm.wps.services.registry.RegistryServiceImpl
com.ibm.wps.services.navigator.NavigatorService = 
     com.ibm.wps.services.navigator.NavigatorServiceImpl
com.ibm.wps.services.siteanalyzer.SiteAnalyzerLogService = 
     com.ibm.wps.services.siteanalyzer.SiteAnalyzerLogServiceImpl
com.ibm.wps.services.portalfilter.PortalFilterService = 
     com.ibm.wps.services.portalfilter.PortalFilterServiceImpl
com.ibm.wps.services.rb.ResourceBundleLoaderService = 
     com.ibm.wps.services.rb.ResourceBundleLoaderServiceImpl
com.ibm.wps.services.xml.XmlAccessService = 
     com.ibm.wps.services.xml.XmlAccessServiceImpl
# Portlet services
com.ibm.wps.portletcontainer.services.PortletFilterService = 
     com.ibm.wps.portletcontainer.services.PortletFilterServiceImpl
# Credential Vault Services
com.ibm.wps.sso.vaultservice.VaultService = 
     com.ibm.wps.sso.vaultservice.VaultServiceImpl
com.ibm.wps.sso.credentialvault.CredentialTypeRegistryService = 
     com.ibm.wps.sso.credentialvault.CredentialTypeRegistryServiceImpl
      

配置 externalAccessControlService.properties

这是与 Tivoli Access Manager 安装关系最密切的配置文件。安装完毕后, accesscontrol.ready 值是 false。您必须先正确地配置 Access Manager 伪指令,并将这个值更改为 true ,Portal 才可以为门户资源创建名称空间条目。这个文件存储在 <was_root>\lib\app\config\services 中。

# Licensed Materials - Property of IBM, 5724-B88, (C) Copyright IBM Corp. 2001,
# 2002 - All Rights reserved.
# ------------------------------------------------- #
# Properties of the External Access Control Service #
# ------------------------------------------------- #

## This flag indicates whether the configuration in this file
## has been configured to connect to the External Security Manager 
accesscontrol.ready=true
## ---------------------------------------
## Access Manager configuration
## ---------------------------------------- 
## After completing the PDJRTE and SrvSslCfg configuration,
## the following directives are needed to
## all Portal to use Access Manager as an External Security Manager
## Set accesscontrol.pdroot to the root of your Protected Object Space for 
## Portal 
accesscontrol.pdroot=/WPS
## Provide the user and password for used to create and access the objects 
## in the Protected Object Space 
accesscontrol.pduser=sec_master 
accesscontrol.pdpw=passw0rd
## Specify the location of the Access Manager properties file for JRTE 
accesscontrol.pdurl=
file:///d:/software/websphere/appserver/Java/jre/PdPerm.properties
## Specify whether to create ACLs in Access Manager for EVERY resource stored 
## externally
## Note: The Tivoli Access Manager administrator will be responsible for all 
## ACL linkages between Tivoli Access Manager and Portal.
## values:
## true - if an Tivoli Access Manager ACL will be created for EVERY resource
## false - if no ACLs will be created for Portal objects 
accesscontrol.createAcl=true 
## Specify the action group and the customized actions to map to Portal permissions.
## The Tivoli Access Manager administrator must create these actions 
## and the action group.
accesscontrol.actionGroup=[WPS]
accesscontrol.viewAction=v
accesscontrol.editAction=e
accesscontrol.manageAction=m
accesscontrol.delegateAction=d
accesscontrol.copyAction=c
accesscontrol.createAction=n 

配置 portallogin.config

在登录会话期间,按下面指定的顺序执行下列模块来向 Java Authentication and Authorization Service 主题植入必需的主体。向每节(stanza)的末尾处添加 PDLoginModule 。这个文件位于 <portal_root>\app\wps.ear\wps.war\WEB-INF\conf\ 处。

WpsNewSubject { 
     com.ibm.websphere.security.auth.module.proxy.WSLoginModuleProxy 
          required delegate=com.ibm.wps.sso.GetCORBACredentialLoginModule;
     com.ibm.websphere.security.auth.module.proxy.WSLoginModuleProxy
          required delegate=com.ibm.wps.sso.CORBACredentialLoginModule;
     com.ibm.websphere.security.auth.module.proxy.WSLoginModuleProxy
          required delegate=com.ibm.wps.sso.UserDNGroupDNLoginModule;
     com.ibm.websphere.security.auth.module.proxy.WSLoginModuleProxy
          required delegate=com.ibm.wps.sso.UserIdPasswordLoginModule;
     com.ibm.websphere.security.auth.module.proxy.WSLoginModuleProxy
          required delegate=com.ibm.wps.sso.UserIdPrincipalLoginModule;
     com.ibm.websphere.security.auth.module.proxy.WSLoginModuleProxy
          required delegate=com.ibm.wps.sso.PasswordCredentialLoginModule;
     com.ibm.websphere.security.auth.module.proxy.WSLoginModuleProxy
          required delegate=com.ibm.wps.sso.LTPATokenLoginModule;
     
        com.ibm.websphere.security.auth.module.proxy.WSLoginModuleProxy
          required delegate=com.tivoli.mts.PDLoginModule;
}; 
WpsSubjectExists {
     com.ibm.websphere.security.auth.module.proxy.WSLoginModuleProxy
          required delegate=com.ibm.wps.sso.GetCORBACredentialLoginModule; 
     com.ibm.websphere.security.auth.module.proxy.WSLoginModuleProxy
          required delegate=com.ibm.wps.sso.CORBACredentialLoginModule; 
     com.ibm.websphere.security.auth.module.proxy.WSLoginModuleProxy 
          required delegate=com.ibm.wps.sso.LTPATokenLoginModule; 
     
        com.ibm.websphere.security.auth.module.proxy.WSLoginModuleProxy 
          required delegate=com.tivoli.mts.PDLoginModule; 
};
      

重新启动 Portal

重新启动 Portal 使这些更改生效。

测试授权

服务器一运行,您就可以看到 Tivoli Access Manager 保护的对象空间中有了一些新对象,包括一个根 /WPS 对象空间和一个 /WPS/EXTERNAL_ACL 条目。在向外部安全管理器添加任何资源之前,您都必须确保用户(通常是 wpsadmin )具有委托和管理 EXTERNAL_ACL 对象的权限。

验证 wpsadmin 权限

为此,请查看 ACL 的 EXTERNAL_ACL-1。如果 wpsadmin 连一个条目都没有,就请向 EXTERNAL_ACL-1 ACL 添加一个用户。可以通过 Tivoli Access Manager Web Portal Manager 或者 pdadmin 命令行完成该操作。要通过命令行添加,请输入:

pdadmin> acl show EXTERNAL_ACL-1
pdadmin> acl modify EXTERNAL_ACL-1 set user wpsadmin T[WPS]md 

pdadmin 命令使用 Tivoli Access Manager 许可权字符串。这张表显示了这些字符串如何映射到 Portal 许可权:


Tivoli Access Manager 许可权字符串 Portal 许可权
[WPS]m管理(Manage)
[WPS]v查看(View)
[WPS]e编辑(Edit)
[WPS]d委托(Delegate)
[WPS]c复制(Copy)

移动欢迎页面

既然允许 wpsadmin 把 WebSphere Portal 和 Tivoli Access Manager 中的门户资源移到外部,那么我们就可以尝试移动一个对象。使用 Portal 提供的登录表单或者使用 TAI,以 wpsadmin 的身份进入您的门户,并继续前进到 Portlet Administration Place 上的 Security 页面,查看所有的区域和页面:


图 4. Portlet Administration Place 上的 Security 页面
 Portlet Administration Place 上 Security 页面的抓屏

选择指向右的箭头


指向右的箭头图标抓屏

将欢迎页面移到外部安全管理器。请记住要在继续操作之前单击 Save 图标。一旦您保存了 ACL 设置,您就无法再修改欢迎页面上的许可权了;您将只看到锁定(lock)图标:


表明用户无法修改欢迎页面抓屏上的许可权的锁定图标的抓屏

现在,您必须转到 Tivoli Access Manager 控制台或 pdadmin 命令行去更改许可权。

查看您的受保护对象空间(Protected Object Space)。有一个新创建的 /WPS/PAGE 对象空间容器和一个新创建的对象 /WPS/PAGE/Welcome(110) 。另请注意一个带资源类型名的 ACL,和一个对象标识(PAGE110)。执行这次移动的用户的缺省许可权字符串是 MANAGE+DELEGATE。如果您想负责创建和维护自己的 ACL,那么请将 externalAccessControlService.properties 中的 accesscontrol.createacl 设置为 false。





回页首


把认证与授权结合在一起并测试它们

目前为止,我们已经在 TAI 部分创建了一个用户 jonsmith ,它的密码是 password12 ,并且已经在“授权”那部分移动了 Tivoli Access Manager 的欢迎页面。您被认证为 jonsmith ,并接着转到 http://webseal_host/wps/myportal 。您将看到下面的 portal 页面:


图 5. 在您被认证为 Jon Smith 后打开的 portal 页面
在您被认证为用户 Jon Smith 后打开的 portal 页面的抓屏


这是因为拥有对外部控制的欢迎页面的访问权的唯一用户是 wpsadmin ;您必须为 jonsmith 添加许可权。从 Tivoli Access Manager Web Portal Manager 或 pdadmin 命令行修改与欢迎页面相关的 ACL,并为 jonsmith 添加 VIEW (T[WPS]v) 许可权。为此,请从命令行输入:

pdadmin>acl modify PAGE110 set user jonsmith T[WPS]v

现在, jonsmith 具有对欢迎页面的“查看(View)”访问权,并且他的门户主页正常显示。您可能需要关闭浏览器并再次登录以便让更改生效。关于更多信息,请参阅下面 最后的说明这一部分。

其它授权测试

除授予用户和组对外部控制的 Portal 资源的访问权之外,您还必须处理特殊的组,比如所有的匿名用户。对于所有的匿名用户,将 Tivoli Access Manager 内未授权用户的许可权字符串添加到期望的资源的 ACL。目前还不支持将 Portal 定义为任何已认证组。

您可能还想授予对所有页面或者所有 portlet 的某些特定许可权。使用 Tivoli Access Manager 的 ACL 继承有可能实现这一点。为此,请在 Tivoli Access Manager 中创建一个 ACL,并将其附加到您要授予访问权的对象所对应的资源类型(例如 /WPS/PAGE )。

例如,如果您想让用户 jonsmith 拥有对存储在外部安全管理器中所有页面的“编辑(EDIT)”许可权,就要创建一个名为 allpages 的 ACL,为 jonsmith 添加“编辑”许可权,然后将这个权限附加到 /WPS/PAGE 对象。

您必须把 Tivoli Access Manager 的附加到任意 PAGE 实例的所有 ACL 拆离以便向 jonsmith 授予对页面的常规编辑访问权。如果您想对个别页面设置更具体的许可权,那么您必须为 jonsmith 在每个 ACL 上复制“编辑”许可权字符串。

pdadmin> acl create allpages
pdadmin> acl modify allpages set user jonsmith T[WPS]e 
pdadmin> acl attach /WPS/PAGE allpages
pdadmin> acl detach "/WPS/PAGE/Welcome Page(101)"





回页首


最后的说明

在使用 Tivoli Access Manager TAI 时您可能希望禁用自动注册。缺省的门户注册在 LDAP 服务器名称空间中创建了一个用户,但没有插入必需的 Tivoli Access Manager 信息。结果,需要手工导入 Tivoli Access Manager 用户才能使新用户登录到门户。请参阅上面 创建用户这一部分。

因为 WebSEAL 即使在您从门户注销了之后仍维护您的身份,所以您必须确保关闭了自己的浏览器或者从 WebSEAL 注销了,以保护您的个人化门户页面。如果您没有这样做,那么将允许您后来访问受保护的 /wps/myportal

一旦资源被移到外部安全管理器,您就无法在门户内更改其名称了,因为门户内的名称是外部安全管理器用来分配其许可权的引用。

根据来自内部数据库和外部安全管理器的许可权完成内部高速缓存。高速缓存在 <was_root>\lib\app\config\services\accesscontrolservice.properties 中设置的可配置时间间隔内被刷新。使用缺省值时,您可能不得不等待 60 秒的时间让访问控制中的更改生效。





回页首


总结

在本文中,我说明了如何把 WebSphere Portal 的认证和授权决定委托给 Tivoli Access Manager。尽管示例演示的是只移动一种资源(即欢迎页面)的情况,但它还显示了在外部安全管理器中维护门户资源所需的配置和管理步骤。



关于作者

Paul Kelsey已经从事 IBM WebSphere 产品系列五年了。他是一个从事 WebSphere Portal 产品研究的顾问软件工程师,专攻外部安全管理器。他的个人爱好包括与他的妻子和两个孩子一起外出、游泳、参加举重训练和打高尔夫球。如果您对本文有什么问题和建议,请通过 pkelsey@us.ibm.com与 Paul 联系。




对本文的评价

太差! (1)
需提高 (2)
一般;尚可 (3)
好文章 (4)
真棒!(5)

建议?




回页首


IBM 公司保留在 developerWorks 网站上发表的内容的著作权。未经IBM公司或原始作者的书面明确许可,请勿转载。如果您希望转载,请通过 提交转载请求表单 联系我们的编辑团队。
    关于 IBM 隐私条约 联系 IBM 使用条款