我一直在搜索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的控制台获得
更新:
基于注释,我切换了设置并找到了在{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更新这个特定的属性?
发布于 2012-06-01 21:04:27
试试这个:
set sec [$AdminConfig getid /Security:/]
foreach descProp [$AdminConfig list DescriptiveProperty $sec] {
set name [$AdminConfig showAttribute $descProp name]
if {$name == "com.ibm.wsspi.security.web.webAuthReq"} {
puts "Updating $descProp"
$AdminConfig modify $descProp {{value persisting}}
}
}用bin/wsadmin -f webAuthReq.jacl执行
发布于 2012-06-06 15:46:50
相当于bkail使用Jython而不是JACL的建议:
import java
import string
sec = AdminConfig.getid('/Security:/')
descProps = AdminConfig.list('DescriptiveProperty', sec)
lineSeparator = java.lang.System.getProperty('line.separator')
descriptiveProperties = descProps.split(lineSeparator)
for descProp in descriptiveProperties:
id = descProp[string.find(descProp, "("):string.find(descProp, ")")+1]
name = AdminConfig.showAttribute(id, 'name')
if name == "com.ibm.wsspi.security.web.webAuthReq":
print "Updating security config object with id: %s, property name: %s. Setting value to 'persisting'" % (id, name)
AdminConfig.modify(id, '[[value persisting]]')https://stackoverflow.com/questions/10856318
复制相似问题