21.4. Using passive credentials

In the previous section, a portlet using an active credential object was built. Although this is the preferred type of credential object, there are certain cases where you have to use passive credential objects, for example when an appropriate active credential class is not available.

In this sample scenario, the portlet will be changed to use a passive credential object. To modify the portlet application, proceed as follows:

1.
In the CredentialJSR project, open the CredentialJSRPortletSecretManager class.
2.
Using the Java editor, add to the class the method shown in Example 21-8 to support passive credentials.
Example 21-8. The getConnectionUsingPassiveObject method (passive credentials)
							public static HttpURLConnection ...

Get IBM Rational Application Developer V6 Portlet Application Development and Portal Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.