避免使用已淘汰的 WSSecurityHelper revokeSSOCookies 方法

此規則會標示下列來自的已淘汰方法 com.ibm.websphere.security.WSSecurityHelper 類別:

此方法在 WebSphere Application Server Traditional 8.5 版中已淘汰,並可能在將來的版本中移除。 在 Liberty 中沒有此方法。

提供的功能 WSSecurityHelper.revokeSSOCookies(HttpServletRequest req, HttpServletResponse res) 取代為 Java Servlet-3.0 規格 logout() 方法。 Java Servlet-3.0 logout() 方法將執行所有工作 WSSecurityHelper.revokeSSOCookies(HttpServletRequest req, HttpServletResponse res) 執行以及執行其他狀態清除,例如使階段作業失效及清除安全 Subject 從執行緒。

請使用新的方法,以便在 WebSphere Application Server Traditional 及 Liberty 中皆相容。 另請注意,使用 logout() 使用中的方法,應用程式需要 WebSphere Application Server V8.0 或更新版本。

在二進位掃描器中,自動修正會取代呼叫 revokeSSOCookies(HttpServletRequest req, HttpServletResponse res) with calls to the logout() 方法。 比方說,下列程式碼

import javax.servlet.http.HttpServletRequest;
...
WSSecurityHelper.revokeSSOCookies(req , res);

會取代為

import javax.servlet.http.HttpServletRequest;
...
req.logout();

此規則具有自動化修正程式。 將自訂配置複製到應用程式建置檔以啟用它。

如需相關資訊,請參閱