Sun Identity Manager 8.1 业务管理员指南

在 Sun JMS Server 中配置 PasswordSync

Identity Manager 可以使用 Java 消息服务 (Java Message Service, JMS) 从 PasswordSync Servlet 中接收密码更改通知。除了确保传送消息外,JMS 还可以将消息传送到多个系统。


注 –

有关此适配器的详细信息,请参见《Sun Identity Manager 8.1 Resources Reference》


本节通过使用示例方案来提供有关使用 Sun JMS 服务器配置 PasswordSync 的说明。

信息通过以下方式进行组织:

示例方案

使用 JMS 服务器配置 PasswordSync 的典型(简单)使用案例是使用户在 Windows 上更改其密码,然后令 Identity Manager 获取新密码,最后在 Sun Directory Server 上使用新密码更新用户帐户。

需要为该方案配置以下环境:

以下文件已复制到 Tomcat common/lib 目录以启用 JMS 和 JNDI:

创建和存储管理对象

本节介绍了用于创建和存储以下管理对象的指令,这些指令是示例方案正常工作所必需的:

您可以将管理对象存储到 LDAP 目录或文件中。如果使用的是文件,该文件的所有实例必须相同。

有关说明,请参见


注 –

将管理对象存储到 LDAP 目录

可以将 PasswordSync 和 JMS 侦听器配置为使用 LDAP 目录中存储的管理对象。图 11–14 展示了该过程。PasswordSync Servlet 和 JMS 侦听器适配器必须从 LDAP 目录中检索连接工厂和目的地设置才能发送和接收消息。

图 11–14 从 LDAP 目录中检索连接工厂和目的地对象

该图展示了如何将 PasswordSync 和 JMS 侦听器配置为使用 LDAP 目录中存储的管理对象

使用 Message Queue 命令行工具

本节介绍了如何使用 Message Queue 命令行工具 (imqobjmgr) 将受管理对象存储到 LDAP 目录中。

存储连接工厂对象

打开 Message Queue 命令行工具 (imqobjmgr),然后键入存储连接工厂对象中的命令以存储连接工厂对象。


示例 11–1 存储连接工厂对象


#> ./imqobjmgr add -l "cn=mytestFactory" 
-j "java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory" 
-j "java.naming.provider.url=ldap://gwenig.coopsrc.com:389/ou=sunmq,dc=coopsrc,dc=com" 
-j "java.naming.security.principal=cn=directory manager" 
-j "java.naming.security.credentials=password" 
-j "java.naming.security.authentication=simple" 
-t qf -o "imqAddressList=mq://gwenig.coopsrc.com:7676/jms" 
Adding a Queue Connection Factory object with the following attributes: 
imqAckOnAcknowledge [Message Service Acknowledgement of Client Acknowledgements] ... 
imqSetJMSXUserID [Enable JMSXUserID Message Property] false 
Using the following lookup name: cn=mytestFactory The object’s read-only state: false 
To the object store specified by: 
java.naming.factory.initial com.sun.jndi.ldap.LdapCtxFactory 
java.naming.provider.url 
ldap://gwenig.coopsrc.com:389/ou=sunmq,dc=coopsrc,dc=com 
java.naming.security.authentication 
simple java.naming.security.credentials netscape
java.naming.security.principal 
cn=directory manager Object successfully added.

存储连接工厂对象中,imqAddressList 定义了 JMS 服务器/代理主机名 (gwenig.coopsrc.com)、端口 (7676) 以及访问方法 (jms)。

存储目的地对象

在 Message Queue 命令行工具 (imqobjmgr) 中,键入存储目的地对象中的命令以存储目的地对象。


示例 11–2 存储目的地对象


#> ./imqobjmgr add -l "cn=mytestDestination" 
-j "java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory" 
-j "java.naming.provider.url=ldap://gwenig.coopsrc.com:389/ou=sunmq,dc=coopsrc,dc=com" 
-j "java.naming.security.principal=cn=directory manager" 
-j "java.naming.security.credentials=password" 
-j "java.naming.security.authentication=simple" 
-t q -o "imqDestinationName=mytestDestination" 
Adding a Queue object with the following attributes: 
imqDestinationDescription [Destination Description] 
A Description for the Destination Object imqDestinationName [Destination Name] 
mytestDestination Using the following lookup name: cn=mytestDestination 
The object’s read-only state: false 
To the object store specified by: 
java.naming.factory.initial com.sun.jndi.ldap.LdapCtxFactory 
java.naming.provider.url ldap://gwenig.coopsrc.com:389/ ou=sunmq,dc=coopsrc,dc=com 
java.naming.security.authentication simple 
java.naming.security.credentials netscape 
java.naming.security.principal cn=directory manager Object successfully added.

您可以使用 ldapsearch 或 LDAP 浏览器来查看新创建的对象。

有关在 LDAP 服务器上存储受管理对象的一节到此结束。请跳过下一节(介绍如何在文件中存储管理对象),并转到为该方案配置 JMS 侦听器适配器上的一节。

将管理对象存储到文件

可以将 PasswordSync 和 JMS 侦听器配置为使用文件中存储的受管理对象。如果未在 LDAP 服务器上存储管理对象(将管理对象存储到 LDAP 目录),请按照本节中的说明进行操作。

存储连接工厂对象

打开 Message Queue 命令行工具 (imqobjmgr),然后键入存储连接工厂对象中的命令以存储连接工厂对象并指定查找名。


示例 11–3 存储连接工厂对象并指定查找名称


#> ./imqobjmgr add -l "mytestFactory" -j 
"java.naming.factory.initial= com.sun.jndi.fscontext.RefFSContextFactory"
 -j "java.naming.provider.url=file:///home/gael/tmp" -t qf -o 
 "imqAddressList=mq://gwenig.coopsrc.com:7676/jms" 
Adding a Queue Connection Factory object with the following attributes: 
imqAckOnAcknowledge [Message Service Acknowledgement of Client Acknowledgements] 
... 
imqSetJMSXUserID [Enable JMSXUserID Message Property] false 
Using the following lookup name: 
mytestFactory 
The object’s read-only state: false 
To the object store specified by: 
java.naming.factory.initial com.sun.jndi.fscontext.RefFSContextFactory 
java.naming.provider.url file:///home/gael/tmp 
Object successfully added. 
To specify a destination: 
#> ./imqobjmgr add -l "mytestQueue" -j 
"java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory" 
-j "java.naming.provider.url=file:///home/gael/tmp" -t q -o 
"imqDestinationName=myTestQueue" 
Adding a Queue object with the following attributes: 
imqDestinationDescription [Destination Description] A Description for the Destination 
Object imqDestinationName [Destination Name] myTestQueue 
Using the following lookup name: 
mytestQueue 
The object’s read-only state: false 
To the object store specified by: 
java.naming.factory.initial com.sun.jndi.fscontext.RefFSContextFactory 
java.naming.provider.url file:///home/gael/tmp 
Object successfully added.

在代理上创建目的地

默认情况下,Sun Message Queue 代理允许自动创建队列目的地(请参见 config.properties,其中 imq.autocreate.queue 的默认值为 true)。

如果没有自动创建队列目的地,则必须使用在代理上创建目的地(其中 myTestQueue 为目的地)中所示的命令在代理上创建目的地对象。


示例 11–4 在代理上创建目的地对象


name (Queue name): 
#> cd /opt/sun/mq/bin 
#>./imqcmd create dst -t q -n mytestQueue 
Username: <admin> 
Password: <admin> 
Creating a destination with the following attributes: 
Destination Name mytestQueue 
Destination Type Queue On the broker specified by: 
------------------------- 
Host Primary Port 
------------------------- localhost 7676 
Successfully created the destination.

您可以将管理对象存储到目录或文件:

为该方案配置 JMS 侦听器适配器

在应用服务器上配置 JMS 侦听器适配器。请按照添加和配置 JMS 侦听器适配器一节中的说明进行操作。

配置活动同步

然后,配置 JMS 侦听器以进行同步。如果使用的是 JMS,则需要活动同步,但不会将其用于直接连接。

Procedure配置 JMS 侦听器以进行同步

  1. 在管理员界面中,单击菜单中的“资源”。

  2. 在资源列表中,选中“JMS 侦听器”复选框。

  3. 在资源操作列表中,选择“编辑同步策略。”

    将打开 JMS 侦听器资源的“编辑同步”页(图 11–15)。

    图 11–15 为 JMS 侦听器配置活动同步

    该图显示了JMS 侦听器资源的“编辑同步”页

  4. 在“通用设置”下找到“代理管理员”,然后选择 pwsyncadmin。(此管理员与空表单相关联。)

  5. 在“通用设置”下找到“进程规则”,然后从列表中选择“同步用户密码”。默认的同步用户密码工作流接受来自 JMS 侦听器适配器的每个请求并签出 ChangeUserPassword 查看器,然后再签回 ChangeUserPassword 查看器。

  6. 在“日志文件路径”框中,指定创建活动和归档日志文件时所在的目录路径。

  7. 出于调试目的,请将日志级别设置为 4 以生成详细日志。

  8. 单击“保存”。