Oracle9iAS Portal Developer Kit
Integrating a Partner Application with Oracle9iAS Portal - Web Provider

Introduction

This document describes how to integrate a partner application with Oracle9iAS Portal.  A partner application is a Web based application which is integrated with the Single Sign-On SSO Server.  Such an application is integrated by creating a provider for it and registering it with Oracle Portal.

This document uses the example application Flights of Fancy, which is implemented as a Web based application, to describe how the integration with Oracle Portal is performed.  The Flights of Fancy application displays a list of flights for a user and provides links to display the details of a flight.

Related Documents

Oracle9iAS Portal Documentation
Oracle Single Sign-On Application Developer's Guide
Oracle9iAS Portal Developer Kit - Installing the PDK-Java Framework and Samples

Partner Application Installation

This section gives an overview of the steps involved in installing this partner application.

CONTENTS

This section describes the files included in the Partner Application example.  These are Java files (*.class, *.jar), provider XML (*.xml), and a bare bones installation script.

Files

Documentation INSTALLATION

Instructions for installing the Flights of Fancy application.  This includes a step to install the Single Sign-On (SSO) SDK since a Partner Application works along with the SSO Server.

Step 1

Perform the required setup required by the SSO Server SDK. The SSO SDK can be downloaded from the PDK site on OTN.  The installation is detailed in the Install.txt in the SDK.

This SDK install includes:

Step 2

Follow the Installing the JPDK and Samples article to install the JPDK on the partner applications listener.

Step 3

Step 4

Step 5

To view the Partner Application, make sure to logout of Oracle Portal.  Go to the following URL in the browser.

http://<web_server>:<port>/servlets/flights

You should notice that because you are not authenticated with the Oracle Portal, you are also not authenticated with this partner application. Login to the Partner Application and view the "Flights of Fancy" application.  You should also be able to change your URL to the Oracle Portal URL and go directly with the Home Page without having to login again.  You can also add this partner application as a portlet within Oracle Portal.

 

IMPLEMENTATION

This section gives an overview of the steps involved in implementing a partner application.  It is not the purpose of this document to describe how to implement partner applications.  However, this overview is given in this section in order to facilitate the description of how to perform the integration with the portal.

Setup

Perform the setup steps described in the file SSO SDK Install.txt.  These steps create the schema where Oracle Web Single Sign-On SDK is installed. One of the steps, the regapp.sql script initializes the enabler APIs in the schema and it requires some information which is obtained from the SSO Server.  The partner application must be registered with the SSO Server in order for this information to be available.

The Flights of Fancy application is implemented on the listener you choose.  The provider for the "Flights of Fancy" application is implemented as a Web provider in samples.jar.  The "Flights of Fancy" provider contains one portlet as defined in provider.xml.

Secure application URLs

The application URLs that are considered secure should perform an application specific security check to determine whether a user has been authenticated.  This security check usually involves the generation of an application cookie.  If the application cookie exists then the URL is processed by the application.  If the application cookie does not exist then the browser redirects the user to the SSO Server for authentication.  The Flights of Fancy application uses the sso_papp_servlet_id cookie for security check.  The sso_papp_servlet_id cookie contains the encrypted username of the currently logged on user.

The process() methods performs a check for the existence of the sso_papp_servlet_id cookie.  All the protected URLs call these methods.  The entry point to the "Flights of Fancy" application from outside the portal is the PartnerServlet class. The entry point to the "Flights of Fancy" application when it is called from inside the portal is the PartnerProvider class. Each of these call the process() methods which check for the existence of the sso_papp_servlet_id cookie as the first step.  If the application cookie does not exist then the browser redirects the user to the SSO Server for authentication.  Once the user is successfully authenticated the SSO Server redirects back to the Flights of Fancy application executing a procedure that the application has specified when it was registered with the SSO Server. When the process() method receives information about the authenticated user from the SSO Server (through the urlc parameter), it creates the sso_papp_servlet_id cookie.  It then displays the requested URL.

These steps are summarized in the following list:

  1. Determine if the sso_papp_servlet_id cookie exists.  If so, it is an indication that user authentication has already been performed by the SSO Server.
  2. If the cookie does not exist it redirects to the SSO Server for authentication.
  3. Once the SSO Server completes user authentication it redirects back to the application.
  4. The URL redirected to by the SSO Server is the success URL specified in the SSO Server for the Flights of Fancy application (urlc in varchar2).  This URL creates the Flights of Fancy application cookie.

  5. After the application cookie is created the requested URL is displayed.
Partner Application Provider Implementation

A partner application is integrated with the portal by creating a provider for it.  The provider should implement portlets for the application that display information about the application and also provide links to drill down to the application.

The provider for the Flights of Fancy application is implemented as a Web provider in the samples.jar. The Flights of Fancy provider contains one portlet as defined in provider.xml.  The portlet displays an overview of flights.  In addition, it provides links to drill down into the Flights of Fancy application.

The Flights of Fancy application extends the default provider and replaces the calls to: initSession and init.

The provider framework allows Web provider implementations to define a initSession() method that providers may use to create application specific browser cookies. The initSession() performs all session and login work. The initSession() method for the Flights of Fancy provider creates the sso_papp_servlet_id cookie.  When a portal page is displayed that contains the Flights of Fancy portlet the initSession() of the Flights of Fancy provider is called, generating the sso_papp_servlet_id cookie.  When the user drills down to the application by accessing one of the links in the portlet, no further user authentication is needed by the application since the sso_papp_servlet_id cookie exists.

The exception to this is if the portal and the partner application exist in separate cookie domains. If this is the case, then selecting a link in the Flights of Fancy portlet will have the same effect as if the Flights of Fancy application was called directly. It will redirect the user to the SSO Server, the SSO Server will see that the user is already authenticated and will redirect the user back to the requested link. At this point, the Flights of Fancy application will create a new sso_papp_servlet_id cookie. In this scenario, if a partner application tracks session information and has the Portal and the partner application in different cookie domains then there is the potentially for two partner application sessions to be created. To avoid this partner applications that track session information should place their application in the same cookie domain as the Portal.

Flights of Fancy Execution Scenarios

The following execution scenarios show the integration of the flights of fancy application with the Oracle Portal and SSO Server.

Scenario 1 - Access the Flights of Fancy application

Access the Flights of Fancy application.  The URL for doing this is the following:

http://<host>:<port>/servlets/flights

Since this is a secure URL it performs a security check to determine if the application cookie exists.  Since the application cookies does not exist yet it redirects to the SSO Server for user authentication.  Once the user logs on the SSO Server redirects back to the application displaying the requested page.  Before the page is displayed the application generates the sso_papp_servlet_id cookie.

Scenario 2 - Access the Portal and then the Flights of Fancy application

Access the Portal and click on the login link.  This causes a redirect to the SSO Server.  Once the user logs on, the SSO Server redirects back to the Oracle Portal Home Page.  Before displaying a page that contains the flights overview portlet, access the Flights of Fancy application from outside the portal (as in Scenario 1).  Since the sso_papp_servlet_id cookie does not exist a redirect is made to the SSO Server.  The SSO Server determines that the user has already been authenticated because of earlier login operation requested by the portal.  As a result the SSO Server performs an immediate redirect back to the flights of fancy application.  This causes the sso_papp_servlet_id cookie to be created without requiring an additional user authentication by the SSO Server.

Scenario 3 - Access the Flights of Fancy application through the Flights of Fancy provider

Access the Portal and click on the login link.  This causes a redirect to the SSO Server.  Once the user logs on the SSO Server redirects back to the portal displaying the home page.  Create a page with the Flights of Fancy portlet and display the page.  When the page is displayed the sso_papp_servlet_id cookie is created because the initSession() method of the Flights of Fancy provider is called.  Access the Flights of Fancy application from outside the portal (as in Scenario 1).  This does not cause a redirect to the SSO Server.  This is so because the Flights of Fancy application sees the sso_papp_servlet_id cookie (which has been created by the initSession() method) and does not perform the redirect to the SSO Server.

You could also add the Flights of Fancy portlet to your own pages and access it directly.

Note for executing the above scenarios:  Each of the above scenarios must be executed in a new browser session.  This is accomplished by quitting all browser windows and restarting the browser before executing each of the scenarios.