我一直在搜索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更新此特定属性?
答案 0 :(得分:2)
相当于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]]')
答案 1 :(得分:1)
试试这个:
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
执行