检测 Websphere Liberty 是否安全?

Detect if Websphere Liberty is secured?

我们正在尝试从传统的 Websphere 迁移到 Liberty 配置文件。出现的几个问题之一是在 WAS 下,我们使用 class com.ibm.ws.security.core.SecurityContext 来检测是否通过调用 isSecurityEnabled() 启用了服务器的安全性。

但是这个 class 在 Liberty 中找不到,因此会产生错误。它在其中一个功能中吗?如果是这样,我不确定如何找到哪一个。如果没有,Liberty 是否有等效的技术?

如果您在 server.xml.

中包含 appSecurity-2.0 功能部件,则可以判断 Liberty 中是否启用了安全性

以编程方式,您可以调用 WSSecurityHelper.isServerSecurityEnabled() 来查明您的 Liberty 服务器是否启用了安全性