在Websphere Application Server上运行基于Filenet的Web应用程序时出现凭据异常

时间:2013-03-14 08:27:59

标签: java websphere jaas filenet-p8 filenet

我开发了一个REST服务,用于从内容引擎存储中检索数据。为简单起见,我使用以下代码创建了具有只读权限的用户帐户并将其用于CE授权:

UserContext context = UserContext.get();
Connection connection = Factory.Connection.getConnection("connection.url");
Subject subject = UserContext.createSubject(connection, "connection.username", "connection.password", "connection.stanza");
context.pushSubject(subject);

在开发过程中,我在本地Tomcat服务器上测试了我的服务,一切正常。现在我已经在ContentEngine所在的Websphere Application Server上部署了该服务,当我尝试访问我的REST服务时,我得到以下异常:

  

错误500:org.springframework.web.util.NestedServletException:请求处理失败;嵌套异常是com.filenet.api.exception.EngineRuntimeException:FNRCS0005E:SECURITY_INVALID_CREDENTIALS:不允许访问Content Engine,因为Content Engine API库或Web服务接口(WSI)侦听器无法找到所需的安全上下文信息。在安全上下文中找不到预期的凭据。

WAS是否需要额外配置才能使此方法有效?或者可能有更好的方法来解决授权问题?

2 个答案:

答案 0 :(得分:4)

我已经设法通过使用不同的节来解决这个问题。我使用的那个( FileNetP8 ,默认值)由于某种原因与Tomcat完美配合但是与Websphere Application Server有问题。在WAS安全登录配置中,我找到了 FileNetP8WSI 节,它可以解决这个问题。

答案 1 :(得分:0)

我使用几乎完全相同的代码通过WebSphere成功连接到CE,但我使用null节

Subject subject = UserContext.createSubject(connection, username, password, null);

这会对你产生影响吗?