首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >wsadmin Web身份验证行为

wsadmin Web身份验证行为
EN

Stack Overflow用户
提问于 2012-06-01 19:34:48
回答 2查看 1.3K关注 0票数 2

我一直在搜索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更新这个特定的属性?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-06-01 21:04:27

试试这个:

代码语言:javascript
复制
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执行

票数 1
EN

Stack Overflow用户

发布于 2012-06-06 15:46:50

相当于bkail使用Jython而不是JACL的建议:

代码语言:javascript
复制
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]]')
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10856318

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档