问题描述
我想使用 facebook 登录 Websphere Portal.我使用 facebook ID 来检索 LDAP uid,但无法获取密码.我可以使用什么 API 无需密码登录门户?
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?
这是我的代码:
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?
推荐答案
你这里描述的是建立一个WebSphere 中的信任关系.你不能通过 PUMA SPI 做到这一点,但这个过程相当简单.
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.
高级步骤是:
- 实现自定义信任关联拦截器类
- 向 WebSphere Application Server 注册
- 在您的 TAI 类中,返回原始逻辑中的 uid.
网上有一些教程.有些是简单,因为如果您的要求是登录,这是一个简单的过程通过用户名/uid.请记住 - TAI 非常强大,因此请务必了解并确定您的 TAI 何时选择执行其逻辑.
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.
希望这会有所帮助,
-Scott H
这篇关于使用 PUMA 在没有密码的情况下将用户登录到 Websphere Portal的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!