Administering Web Services for Remote Portlets for Sun Java System Portal Server 7.1Sunil Bhaskaran, July 2007 This article provides information on administering Web Services for Remote Portlets (WSRP) in Sun Java System Portal Server 7.1 (Portal Server). It is assumed that the readers have basic knowledge about the producer and consumer concept in WSRP. The article describes how to use WSRP and the guidelines and best practices for using WSRP. Contents
Overview of WSRPWSRP is a standard that provides web service-based access capability to portlets and provides interoperability among different portal server solutions. WSRP is a presentation-oriented web service. Unlike common web services that carry only the raw data as the result of a request, a WSRP response carries fully rendered markup to be included within a portal page. See see the oasis-open.org web site for the WSRP v.1 OASIS 200304 standard, FAQs, and white papers. WSRP has two key elements: producer and consumer.
Administering WSRP Producers for Portal ServerCreate a producer if you want to offer locally deployed portlets remotely to other portals that act as WSRP consumers. A portal can host multiple producers and each producer can export multiple remote portlets. A producer is a grouping mechanism that exports any number of portlets. The consumer can consume remote portlets offered by a producer. Based on the portlets that you want to provide to WSRP consumers, you can create one or more producers. A producer might require consumers to register with it. Registration is a process in which the consumer and the producer enter into a relationship that enables the producer to identify the consumer. A producer either supports registration or it does not support registration. If a producer supports registration, consumers must register to work with the producer. If a producer does not support registration, it is referred to as a registration-less producer and does not require registration. This section contains the following tasks that need to be performed at the Portal Server producer to offer locally deployed portlets to a consumer:
To Navigate to the WSRP Producer Options in the Portal Server Administration Console 1. Log in to the Portal Server administration console. 2. In the Portal Server administration console, click the Portal tab. The screen displays available portals. 3. Click the portal name hyperlink. 4. Click the WSRP tab. 5. Click Producer tab. To Create a Producer That Supports Registration 1. If you are not on the Producer tab, see To Navigate to the WSRP Producer Options in the Portal Server Administration Console. 2. Select the organization's distinguished name (DN) where you want to create a producer and click the Producer tab. Each organization can offer any number of WSRP producers. The WSRP Producers table displays all producers that already exist. Select the DN (Distinguished Name)of an organization or sub-organization based on the availability of portlets. Note - Organizations are created in Sun Java System Identity Server. 3. Click New to create a new producer. 4. Type a name to identify the producer. The name of the producer should be unique and should contain valid characters. The producer name is used to create the WSDL URL of this producer. 5. Select Required for Registration to create a producer that supports registration. If a producer does not support registration, it cannot identify the consumer because the producer does not build a relationship with the consumer. Hence the consumer can not customize the portlets that are offered by the producer. Select Support Registration if you want the producer to support customization of portlets. 6. Select Supported for Inband Registration if you want the consumer to enter the details using the Portal Server application interface. 7. To add a registration property, click Add Row. Enter the values. Enter the name of the registration property and description. Registration properties are the details that you want to get from the consumer when the consumer registers to a specific producer. The registration properties entered by the consumer can be validated through the Registration Validation class. 8. Select Supported for out-of-band Registration if you want the consumer to provide the details through out-of-band communication, such as phone calls, emails, and so on. 9. Click Next. The Review screen displays the details that you entered. Review the details. You can click Previous and change the details you entered. 10. Click Finish to create the producer. To Create a Producer That Does Not Support Registration 1. If you are not on the Producer tab, see To Navigate to the WSRP Producer Options in the Portal Server Administration Console. 2. Select DN. The WSRP Producers table displays all producers that are already configured. 3. Click New to create a new producer. 4. Type a name to identify the producer. The name of the producer should be unique and should contain valid characters. The producer name is used to create the WSDL URL of this producer. 5. Select Registration Not Required. 6. Click Finish. To Publish Portlets and Enable a Producer 1. If you are not on the Producer tab, see To Navigate to the WSRP Producer Options in the Portal Server Administration Console. 2. In the Producer tab, click the producer name hyperlink. The Edit Properties screen appears. The screen displays the WSDL URL, which is a unique URL for a specific producer through which the consumer accesses the producer. 3. Add one or more published portlets to the producer. The Unpublished Portlet list displays a list of local portlets that are available in the system and can be exported as remote portlets. Note - The producer must have at least one published portlet to enable it. 4. Select a portlet, and click Add to add the portlets to the producer. 5. Edit the Registration Validation Class field if you want to validate the registration properties. The You can customize the 6. Click Save to save the changes and edit the Enable check box. 7. Select Enable to enable the producer and click Save. To Generate a Registration Handle 1. If you are not on the Producer tab, see To Navigate to the WSRP Producer Options in the Portal Server Administration Console. 2. Click the producer name for which you want to create a registration handle. 3. Click the Consumer Registration tab. The screen displays all consumers that are registered to the specific producer. 4. Click New to create a new registration handle. 5. Type details, such as name, status, consumer agent, and method.
6. Click Next. The screen displays the registration property values that you specified while creating the producer. Review the details and change the details if required. 7. Click Finish to create a registration handle. To Publish Producer Details to the Service Registry 1. Create an organization data file and a producer data file that include the organization and producer details to publish to the service registry. The organization data file can contain the following entries:
Note - The The producer data file should have the following entries:
Note - To be able to search for the details of producer, organization, or portlet, you must create at least one data file associated with. 2. Stop and restart the common agent container using the following commands:
3. To publish the producer details to the Service Registry, use the following command: ../psadmin publish-registry -u amadmin -f password-file -p portal1 -m producer -U producer-data-filename -O organization-data-filename Note - The portlet-file file specifies the portlets that are offered by the WSRP producer.
Type the portlets list as a string within double quotes with the elements separated by a space, for example,
You can check the log file by using the following command: more var/opt/SUNWportal/logs/admin/portal.admin.cli.0.0.log Note - For more information on the To Configure Portal Server to Use Service Registry 1. On the machine where Portal Server is installed, create the directory,
2. Copy 3. In the Sun Java System Portal Server Portal Server administration console, click the Portal tab. Click the SSO Adapter tab. 4. Click JES-REGISTRY-SERVER. The Edit Meta-adapter - JES-REGISTRY-SERVER screen appears. 5. Type the following details. If you are accessing Service Registry through a proxy server, type the following details:
If you do not use a proxy server, type the following information:
6. In Access Manager, add SSO Adapter Service to the Access Manager administrator. To Search for Producer Details 1. Create a search producer data file that contains the details that you want to search. The search producer data file can contain any of the following:
Note - The search producer data file contains a description of the producer in the
registry. Use the percentage sign (%) for a wildcard search. For example, use 2. To search for a producer in the registry, use the following command: ../psadmin search-registry -m consumer -u amadmin -f ps-password -C search-producer-datafile -p portal1 Administering WSRP Consumers for Portal ServerThis section explains the tasks that need to be performed to configure Portal Server to consume remote portlets offered by the producer.
To Navigate to the WSRP Consumer Options in the Portal Server Administration Console 1. Log in to the Portal Server administration console. 2. Click the portal name hyperlink. 3. Click the WSRP tab. To Add a Configured Producer 1. If you are not on the Producer tab, see To Navigate to the WSRP Consumer Options in the Portal Server Administration Console. 2. Select DN. Click New to create a new configured producer. 3. Type the configured producer name. Select the identity propagation mechanism. By default, None is selected. An identity propagation mechanism allows the users of the consumer portal to present their credentials to the producer portal and allows the users to federate their identity from the consumer portal to the producer portal. For more details on identity propagation mechanism, see Identity Propagation Mechanism. 4. Type the WSDL URL and click Next. Note - You can search for a WSDL URL based on the producer or portlet if you do not know the WSDL URL of the producer. The search result displays the WSDL URL of a producer only if the producer is published. For more information on how to search for a producer using the command-line interface, see To Search for Producer Details. 5. (Optional) If the producer requires registration, you can register the producer using either of two methods:
6. Click Next. 7. If you selected the first method in Step 5, enter the registration properties and click Next. If you selected the second method, enter the registration handle obtained through out-of-band communication, and click Next. 8. Review the details and click Finish. To Create Channels to Display Remote Portlets on the Portal Desktop 1. Log in to the Portal Server administration console. 2. Click the portal name hyperlink. 3. Select the DN on which you want to create a remote portlet. 4. Click Manage Channels and Containers. 5. Select the container to which you want the remote portlet to appear. 6. Click New Channel or Container on the right tab. A wizard appears. 7. Select portal, DN, and Channel. 8. Click Next and select WSRP Remote Portlet Channel. 9. Click Next. The screen displays the list of available configured producers. 10. Select the configured producer and click Next. The Remote Portlet list displays the list of remote portlets that the producer offers. 11. Select the remote portlet and click Next. 12. Provide a local channel name for the remote portlet. 13. Click Finish to create a remote portlet on your portal desktop. 14. Log in to portal desktop as a user and select the container or tab on which you created the remote portlet. The portlet is visible on your portal page. To Access a Producer Through a Gateway 1. In a text editor, edit the following file: /var/opt/SUNWappserver/domains/domain1/config/domain.xml 2. Set the following Java Virtual Machine (JVM) options: 3. Save the file. To Update the Service Description 1. If you are not on the Consumer tab, see To Navigate to the WSRP Consumer Options in the Portal Server Administration Console. 2. Select DN (Distinguished Name). 3. Click the configured producer hyperlink. 4. In the Edit Configured Producer screen, click Update Service Description. 5. Check the local repository/cache for the new portlets offered by this producer. 6. Create a new channel to see if any new portlets are offered by the producer. To Export Roles as User Categories in Producer 1. In the Access Manager administrator console, create a role and add a user. 2. While deploying the portlet in webxml of the portlet application, add the following code: security-role> role-name>PS_TEST_DEVELOPER_ROLErole-name> /security-role> 3. Add the following lines in the security-role-ref> role-name>PS_TEST_DEVELOPER_ROLErole-name> role-link>PS_TEST_DEVELOPER_ROLErole-link> /security-role-ref> 4. Create the portlet application WAR file. 5. Create a roles file with the following entry. cn\=AM_TEST_DEVELOPER_ROLE,o\=PortalSample,dc\=domain, dc\=domain,dc\=com=PS_TEST_DEVELOPER_ROLE 6. Deploy the portlet using the following command. /opt/SUNWportal/bin/psadmin deploy-portlet -u amadmin -f ps-password -d "o=PortalSample,dc=domain,dc=domain,dc=com" -p portal1 -i portlet-name --rolesfile roles-file test-portlet-war-file This task deploys a portlet. All roles associated with the portlet are automatically exported as user categories in the producer. To Map User Categories to a Role 1. If you are not on the Consumer tab, see To Navigate to the WSRP Consumer Options in the Portal Server Administration Console. 2. In the Consumer tab, click the configured producer name hyperlink. User Category displays the roles in the producer portlet. Local Roles displays the roles that are defined for the consumer's Access Manager. 3. In the User Categories to Role Mapping section, map user categories to the roles defined at the consumer. 4. Click OK to save the details. Mapping Consumer Attributes The producer does not have any real user identity and does not have any data associated with the user. The consumer propagates the common user details known as user profiles. The consumer chooses some of the common attributes such as name, address, and so on and optionally propagates these attributes to the producer. The producer can generate some meaningful data based on the user. The Portal Server implementation of WSRP Consumer maps common user attributes stored in the user entry on the Sun Java System Directory Server to the standard set of user attributes that the WSRP specification mandates. If a consumer portlet uses any of the attributes that are not specified in the LDAP schema, create a custom object class to store these attributes and add this object class to the user entry. After you create the attributes, map the LDAP attribute to the corresponding WSRP attribute using the Sun Java System Access Manager administrator console. Mapping the LDAP attribute to the corresponding WSRP attribute allows the consumer to propagate custom user profile data that might be required by the producer. Identity Propagation Mechanism Identity propagation is a mechanism by which the WSRP consumer supplies the identity of the user to the WSRP producer web service. Users federate their identity between the consumer and producer. After a successful federation, the consumer portal propagates the user identity to the producer portal. The WSRP producer, after receiving the user credentials from the consumer, validates the credentials and allows or denies access to the resource in the specified user context. The user has two identities for each portal: one for the producer portal and the other for the consumer portal. Users federate these identities using the identity propagation mechanism, which provides single sign-on for the consumer and the producer portal. When the user logs into the portal through the consumer portal, the user gets the content that the user gets when directly logged in to the producer portal. The changes that the user makes using the federated identity would be available when the user logs in to the producer portal. Identity Propagation Mechanism at the Consumer of Portal Server The consumer can set the identity propagation because the consumer has knowledge about end users. There are two phases in setting up the identity propagation: Administrator setup: The administrator of the consumer portal discovers that the producer supports specific identity propagation mechanisms. Then, the administrator sets up the system that allows the user to use identity propagation. User setup: The end user federates its identity by populating the credentials. The WSRP Producer available through Portal Server supports the following identity propagation mechanisms:
In the previous list, WSS User Name Token Profile (Username only), WSS User Name Token Profile (With password digest), and WSS User Name Token Profile (With password text) implement the OASIS WSS Username token profile specification. This specification describes how to use the user name token with web services. The WSS specification describes how a web service consumer can supply a user name token by identifying the requestor by user name, and optionally using a password to authenticate that identity to the web service producer. After the consumer is created, the administrator has to create remote channels based on the identity propagation mechanism supported by the consumer. After the channels are available on the user desktop, they are ready to accept identity propagation. To Create User Credentials Using WebServices SSO Portlet 1. Log in to Portal Server. 2. In the WebServices SSO Portlet section, click Edit. 3. In the Create NewToken Profile section, select the WebService URL for which you want to create a user token profile. 4. Type the user name and password. Click Add to add the user name and password. You can also edit or remove an existing user token profile. Identity Propagation at Producer The identity propagation mechanism is set at the producer automatically. Portal Server supports the following identity propagation mechanisms: Sun SSO Token, OASIS user name token (all its variants), and No identity propagation. Configuring the Sun Java System WSRP Producer to Accept Digest Passwords
To Configure the Sun Java System WSRP Producer to Accept Digest Passwords 1. Run the following command to change the password storage scheme of the Directory Server so that plain text passwords are stored. /opt/SUNWdsee/ds6/bin/dscfg set-server-prop pwd-storage-scheme:CLEAR 2. Create a new user in the Access Manager console to ensure that the Username Token Profile with Password Digest can be used. Best Practices for Using Identity Propagation Mechanism
Accessing Sun Resources OnlineThe docs.sun.com web site enables you to access Sun technical documentation online. You can browse the docs.sun.com archive or search for a specific book title or subject. Books are available as online files in PDF and HTML formats. Both formats are readable by assistive technologies for users with disabilities. Sun Welcomes Your Comments Sun is interested in improving its documentation and welcomes your comments and suggestions. For documentation feedback, use this form. For More InformationFor more resources, see the Sun Java Enterprise System hub on the BigAdmin portal for systems administrators: http://www.sun.com/bigadmin/hubs/javaes/.
Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
| ||||||||||||||||||||||||||||||||||||||||||||||||||