| Creation Date: | January, 18 2002 |
| Status: | Production |
| Version: | PDK Release 2, (9.0.2 and later) |
In the article How to Build a URL-Based Portlet, you learned how to create a portlet that displayed the content of a URL-based application. The example used in that article was Google.com. However, often, you may wish to create a URL-based portlet that retrieves its content from an external application that is protected. In other words, the URL you wish to display in your portlet may require you to enter specific user credentials. With the PDK, you can create URL-based portlets that provide single sign-on to external applications requiring user credentials.
This article shows you how to create a URL-based portlet with Single Sign-On to an external application requiring user credentials. The example used in this article is MyYahoo! Weather. This example uses cookie-based sign-in. If the URL you are using uses a different sign-in mechanism (i.e., basic authentication), please refer to the appropriate article.
Using a text editor, create an XML file for your portlet provider. Use the authentication and authType tags to specify that this portlet is to use external application-based authentication. You may use the sample XML file below (you must change the httpProxyHost and httpProxyPort values to point to your own proxy server and port). Please refer to the article Understanding provider.xml for URL-Based Portlets for an explanation of the required XML tags and their functions.
After you have created the file, save it somewhere on your file system and call it "provider.xml".
<?xml version = '1.0' encoding = 'UTF-8'?> <?providerDefinition version="3.1"?> <provider class="oracle.portal.provider.v2.http.URLProviderDefinition"> <providerInstanceClass>oracle.portal.provider.v2.http.URLProviderInstance</providerInstanceClass> <session>true</session> <authentication class="oracle.portal.provider.v2.security.Authentication"> <authType>ExternalApp</authType> <errorPageMessages>Invalid Yahoo ID/Password.</errorPageMessages> </authentication> <proxyInfo class="oracle.portal.provider.v2.ProxyInformation"> <httpProxyHost>www-proxy.us.oracle.com</httpProxyHost> <httpProxyPort>80</httpProxyPort> </proxyInfo> <portlet class="oracle.portal.provider.v2.http.URLPortletDefinition"> <id>1</id> <name>Yahoo Weather Portlet</name> <title>Yahoo Weather Portlet</title> <description>This is a PDK-URL Services sample portlet thatdemonstrates single sign-on to an external application.</description> <timeout>100</timeout> <timeoutMessage>yahoo timed out</timeoutMessage> <acceptContentType>text/html</acceptContentType> <showEdit>false</showEdit> <showEditToPublic>false</showEditToPublic> <showEditDefault>false</showEditDefault> <showPreview>false</showPreview> <showDetails>false</showDetails> <hasHelp>false</hasHelp> <hasAbout>false</hasAbout> <renderer class="oracle.portal.provider.v2.render.RenderManager"> <showPage class="oracle.portal.provider.v2.render.http.URLRenderer"> <contentType>text/html</contentType> <pageUrl>http://weather.yahoo.com</pageUrl> <filter class="oracle.portal.provider.v2.render.HtmlFilter"> <headerTrimTag><body</headerTrimTag> <footerTrimTag>/body></footerTrimTag> </filter> </showPage> </renderer> <securityManager class="oracle.portal.provider.v2.security.URLSecurityManager"> <authorizType>public</authorizType> </securityManager> </portlet> </provider>
To configure and deploy your provider on OC4J, please see the section called "Deploying Your Provider on OC4J" in the article, How to Build a URL-Based Portlet.
You now need to create a new external application in Oracle9iAS Portal for the Yahoo! Single Sign-On Portlet. This external application map any given Portal user to a desired Yahoo! account so that every Portal user can have Single Sign-On access to Yahoo! Weather.
If you are registering your provider on Oracle9iAS Portal 3.1, the registration wizard will include fields for both the provider URL and the service identifier (it will still include fields for name, display name, description, etc., see the steps below). You should specify both the URL and the service name.
For Oracle9iAS Portal 3.0.9, you must register the provider by appending the service ID to the provider URL as shown below.
Now add your new portlet to a page. If you have not already entered your Yahoo! credentials into the Single Sign-On Server, you will see a message telling you to Update Login Information. Click the link to enter your Yahoo! account username and password. After entering your credentials you will see the Yahoo! Weather portlet.
Now that you have successfully built your own external application portlet using the PDK, please look for future articles that will guide you through adding services to your portlet such as SSL handling, inline rendering of links, parameter passing, etc.
Here are some reference articles to help you better understand the architecture and technical details of URL-based portlets:
| Revision History: |
|
| Oracle Corporation World Headquarters 500 Oracle Parkway Redwood Shores, CA 94065, USA http://www.oracle.com/ |
Worldwide Inquiries: 1-800-ORACLE1 Fax 650.506.7200 |
Copyright and Corporate Info |