Question

I want to use facebook to login into Websphere Portal. I use facebook ID to retrieve LDAP uid, but cannot get password. What API can I use to login to portal without password?

Here is my code:

Context ctx = new InitialContext();
PortletServiceHome pumaHomeService = (PortletServiceHome) ctx.lookup("portletservice/com.ibm.portal.um.portletservice.PumaHome");
PumaHome pumaHome = pumaHomeService.getPumaService().getPortletService(PumaHome.class);
PumaLocator pumaLocator = pumaHome.getLocator(request);
List<User> users = locator.findUsersByAttribute("uid", "testUser");
User pumaUser = users.get(0);
// How to login this pumaUser without password?
Was it helpful?

Solution

What you describe here is the establishment of a trust relationship in WebSphere. You can't do this via the PUMA SPI but the process is fairly straightforward.

The high level steps are:

  1. Implement a custom Trust Association Interceptor class
  2. Register it with WebSphere Application Server
  3. In your TAI class, return the uid from your original logic.

There are a few tutorials online. Some are simple, as it is an easy process if your requirement is to log in via username / uid. Bear in mind - TAIs are very powerful, so be sure to understand and be certain when your TAI chooses to perform its logic.

Hope this helps,

-Scott H

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top