I am creating a JSF portlet using RAD7 which needs to access a shared credential. While creating the project, I selected to include credential vault support. Selecting this option adds the portlet-cv.jar to the WebbApp library. How do you use the PortletSecretManager to retrieve credentials?

It looks like it should be a straight forward transaction, but when I try to get a credential within a Faces ManagedBean, an error is thrown "java.lang.IllegalStateException: The internal portlet request cannot be found"


FacesContext context = FacesContext.getCurrentInstance( );

PortletExternalContextWrapper ex =

(PortletExternalContextWrapper) context.getExternalContext();

PortletRequest request = (PortletRequest)ex.getRequest();

try {

cred = PortletSecretManager.getSharedCredential(request, "myCreds");

} catch ...

When I try similar code in the doView() method of the Portlet class. I do not get an exception, but I am not able to access the shared credential.

In my portal environment, there is a shared credential called "myCreds". It is set and is being used by other portlets that were created using Portlet Factory.

Is there sample code available describing how to use the PortletSecretManager class?

What is the expected input parameter for the method PortletSecretManager.getSharedSlotNames(Map map)?

How can I access a shared credential and make it available to my Faces Managed Bean?

All the best,