题
我正在开发一个独立的定义注册表,定义登录件中,与定义的配置文件组件的Websphere门户网站6.1.一些现有的用户尚未完成所需的一个或多个领域在他们的个人资料。
下一次,这些用户登录在成功,我怎么能得到的门户网站将它们重定向到该定义概portlet 之前 给他们访问其他的站点?
解决方案
它看起来像Websphere门户网站6.1来API发送的认证要求通过一个链的过滤器。我发现了一篇文章描述API在开发工作('新的安全Api Websphere门户网站').
特别是,com.ibm。门户网站。auth.ExplicitLoginFilter接口可以让你塞在认证期间序列和动态的变化系统的重定向后用户的凭据进行验证。这里是一个短连的例子:
public class CustomLoginFilter implements ExplicitLoginFilter {
public void login(HttpServletRequest req, HttpServletResponse resp,
String userId, char[] password,
FilterChainContext portalLoginContext, Subject subject,
String realm, ExplicitLoginFilterChain chain)
throws LoginException, WSSecurityException,
com.ibm.portal.auth.exceptions.LoginException {
//Validate the user's credentials.
chain.login(req, resp, userId, password, portalLoginContext, subject, realm);
//Redirect to profile portlet if required profile fields are incomplete.
if(incompleteProfile(userId)) {
portalLoginContext.setRedirectURL(getURLForProfilePortlet());
}
}
//Other methods...
}
该ExplicitLoginFilter及其依赖于在以下瓶子文件,其中必须添加类路径时,编译代码:
从你的Websphere门户根目录...
/base/wp.auth.base/shared/app/wp.auth.base.jar
/base/wp.base/shared/app/wp.base.jar
不隶属于 StackOverflow