如何在 WLST 脱机的情况下在安全域中配置 Weblogic 用户



我有一个weblogic域,

  1. 我使用Web控制台将一些用户添加到默认安全域(myrealm(。
  2. 然后我关闭网络逻辑。
  3. 并运行一个脱机 WLST 脚本,该脚本从此域目录中读取域(...(,并使用 writeTemplate(...( 命名模板创建一个模板.jar
  4. 运行另一个 WLST 脚本以从模板创建新域.jar
  5. 我启动新域。

然后我发现myrealm中的用户不见了。我是weblogic和WLST的新手。似乎WLST没有将用户/密码导出到模板?如何使安全域用户/密码预先配置 WLST?所以我不需要手动创建很多用户/密码?

由于Weblogic嵌入式LDAP的性质,您必须在在线模式下执行此操作。如果您转到以下位置,则可以通过控制台执行此操作:

Home >Summary of Security Realms >myrealm >Users and Groups>Migration tab

导出域并导入到新域中。

这可以通过在线工作来完成,例如:

connect('weblogic','weblogic', 't3://origDomain:7001')
domainRuntime()
cd('/DomainServices/DomainRuntimeService/DomainConfiguration/FirstDomain/SecurityConfiguration/FirstDomain/DefaultRealm/myrealm/AuthenticationProviders/DefaultAuthenticator')
cmo.exportData('DefaultAtn','/tmp/your.ldif', Properties())
connect('weblogic','weblogic', 't3://newDomain:8001')
domainRuntime()
cd('/DomainServices/DomainRuntimeService/DomainConfiguration/SecondDomain/SecurityConfiguration/SecondDomain/DefaultRealm/myrealm/AuthenticationProviders/DefaultAuthenticator')
cmo.importData('DefaultAtn','/app/userdata/abc.ldif', Properties())

最新更新