Login User into Websphere Portal without password using PUMA

浪尽此生 提交于 2019-12-25 07:59:27

问题


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?

回答1:


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



来源:https://stackoverflow.com/questions/14528457/login-user-into-websphere-portal-without-password-using-puma

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!