[英]WLST to add a user condition to a existing global role
我正在嘗試在安全領域 -> myrealm -> 角色和策略 -> 全局角色 -> 角色 -> 測試角色 -> 查看角色條件下添加用戶條件。 在那里我單擊“添加條件”按鈕,然后在謂詞列表中選擇用戶並在用戶參數名稱中輸入用戶名並保存。
我確實嘗試過來自 Oracle 支持的 cmo.getSecurityConfiguration().getDefaultRealm().lookupRoleMapper("XACMLRoleMapper") ,但我不確定如何使用 wlst 實現這一點。
你能幫我解決這個問題嗎?
據我了解,通過使用下面的 WLST 腳本,它將幫助您創建用戶、組並讓您知道如何將用戶添加到現有角色。 1
connect(‘weblogic’,’weblogic’,’t3://localhost:7001′)
edit()
startEdit(-1,-1,’false’)
serverConfig()
cd(‘/SecurityConfiguration/First_Domain/Realms/myrealm/AuthenticationProviders/DefaultAuthenticator’)
cmo.createUser(‘faisal’,’weblogic’,”)
cmo.groupExists(‘TestGrp’)
cmo.createGroup(‘TestGrp’,”)
cmo.addMemberToGroup(‘testgrp’,’faisal’)
cd(‘/SecurityConfiguration/First_Domain/Realms/myrealm/RoleMappers/XACMLRoleMapper’)
cmo.setRoleExpression(”,’Admin’,’Grp(TestGrp)|Grp(Administrators)’)
edit()
undo(defaultAnswer=’y’, unactivatedChanges=’true’)
stopEdit(‘y’)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.