【发布时间】:2012-06-01 19:34:48
【问题描述】:
我一直在搜索 IBM 文档以试图找到它,但我一直空无一物。有谁知道使用 wsadmin 为 WAS 7.0 设置配置“Web 身份验证行为”的相关脚本/命令?
我正在查看的设置可以从Security > Global Security > Web and SIP security > General Settings > Authenticate only when the URI is protected > Use available authentication data when an unprotected URI is accessed 控制台访问
更新:
基于 cmets,我切换了设置,并在 {profile}/security.xml 中找到了更改的配置。
这是未选中“访问未受保护的 URI 时使用可用的身份验证数据”复选框的样子:
<webAuthAttrs xmi:id="DescriptiveProperty_8" name="com.ibm.wsspi.security.web.webAuthReq" value="lazy" type="String" displayNameKey="" nlsRangeKey="" hoverHelpKey="" range="lazy,persisting,always" inclusive="false" firstClass="false"/>
这是我检查后的样子(这是我试图用 wsadmin 做的):
<webAuthAttrs xmi:id="DescriptiveProperty_8" name="com.ibm.wsspi.security.web.webAuthReq" value="persisting" type="String" displayNameKey="" nlsRangeKey="" hoverHelpKey="" range="lazy,persisting,always" inclusive="false" firstClass="false"/>
所以现在的问题是,如何使用 wsadmin 更新这个特定属性?
【问题讨论】:
-
我不知道答案,但是如果您更改控制台中的设置并检查 PROFILE_HOME/wstemp/ 目录,您应该会找到更新的配置,您可以将其与 PROFILE_HOME/config/ 进行比较.
-
感谢您的评论。根据您的建议,我更改了设置,发现 security.xml 中的此设置已更改:
<webAuthAttrs xmi:id="DescriptiveProperty_8" name="com.ibm.wsspi.security.web.webAuthReq" value="persisting" type="String" displayNameKey="" nlsRangeKey="" hoverHelpKey="" range="lazy,persisting,always" inclusive="false" firstClass="false"/>。那么有没有办法使用 wsadmin 来设置呢? -
这看起来和我的一样,所以我建议用之前/之后更新问题。无论如何,在 wsadmin jacl 中,您想要
set sec [$AdminConfig getid /Security:/]之类的东西,然后循环遍历$AdminConfig list DescriptiveProperty $sec,然后是set name [$AdminConfig getAttribute $dc name],然后根据您要设置的内容查找等于com.ibm.wsspi.security.web.webAuthReq,然后是$AdminConfig update $dc [[...]]。
标签: websphere-7 wsadmin