【问题标题】:Credentials exception when running Filenet-based web app on Websphere Application Server在 Websphere Application Server 上运行基于 Filenet 的 Web 应用程序时出现凭据异常
【发布时间】:2013-03-14 08:27:59
【问题描述】:

我开发了一个 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: 不允许访问内容引擎,因为内容引擎 API 库或 Web 服务接口 (WSI) 侦听器找不到所需的安全上下文信息。在安全上下文中找不到预期的凭据。

WAS 是否需要任何额外的配置才能使这种方法发挥作用?或者也许有更好的方法来解决授权问题?

【问题讨论】:

    标签: java websphere jaas filenet-p8 filenet


    【解决方案1】:

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

    【讨论】:

    • 正确的节只是一个字符串参数,使用“FileNetP8WSI”而不是null:UserContext.createSubject(conn, "user", "password", "FileNetP8WSI")
    【解决方案2】:

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

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

    这对你有影响吗?

    【讨论】:

    • 实际上,当我们使用 NULL 节值时,它会被默认值“FileNetP8”替换。所以,不幸的是,它没有
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-22
    相关资源
    最近更新 更多