我開發了一種REST服務,用於從內容引擎存儲中檢索數據。爲簡單起見,我創建的用戶帳戶具有隻讀權限,並用它進行CE認證,使用下面的代碼:在Websphere Application Server上運行基於Filenet的Web應用程序時的憑據異常
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服務器,一切都在正常工作。現在,我已經部署在WebSphere Application Server上服務,其中ContentEngine所在,當我嘗試訪問我的REST服務,我得到以下異常:
錯誤500:org.springframework.web.util.NestedServletException:請求處理失敗;嵌套異常爲com.filenet.api.exception.EngineRuntimeException:FNRCS0005E:SECURITY_INVALID_CREDENTIALS:由於內容引擎API庫或Web服務接口(WSI)偵聽器無法找到所需的安全上下文信息,因此不允許訪問Content Engine。在安全上下文中找不到預期的憑據。
WAS是否需要額外的配置才能使此方法有效?或者也許有更好的方法來解決授權問題?
正確的節只是一個字符串參數,使用「FileNetP8WSI」而不是null:UserContext.createSubject(conn,「user」,「password」,「FileNetP8WSI」) – 2018-01-04 08:58:32