2008-11-26 65 views
3

我想创建一个WLST脚本来创建我的Weblogic域。不过,我在添加LDAP配置时遇到问题。可以使用WLST Offline将NovellAuthenticators(LDAP)添加到Weblogic中吗?

cd("/SecurityConfiguration/myDomain") 
cmo.createRealm("myrealm") 

cd("/SecurityConfiguration/myDomain/Realms/myrealm") 
cmo.createAuthenticationProvider("myLDAP", "weblogic.security.providers.authentication.NovellAuthenticator") 

这是目前失败,因为在这一点上我不似乎有一个SecurityConfiguration对象

No SecurityConfiguration object with name myDomain 

这是否配置有可在线?还有其他的解决方法吗?

回答

1

从我发现的情况来看,此配置必须使用WLST Online完成。

我所创建的脚本看起来像这样

connect("username", "password", "t3://ip:port"); 

edit() 
startEdit() 

create_AuthenticationProvider_54("/SecurityConfiguration/myDomain/Realms/myrealm", "value") 
cd("/SecurityConfiguration/myDomain/Realms/myrealm") 
cmo.createAuthenticationProvider("myLDAP", "weblogic.security.providers.authentication.NovellAuthenticator") 

cd("/SecurityConfiguration/myDomain/Realms/myrealm/AuthenticationProviders/myLDAP") 
set("GroupBaseDN", "value") 
set("UserNameAttribute", "value") 
set("StaticGroupObjectClass", "value") 
set("UserBaseDN", "value") 
set("UserObjectClass", "value") 
set("AllGroupsFilter", "value") 
set("Principal", "value") 
set("UseRetrievedUserNameAsPrincipal", "value") 
set("Host", "value") 
set("StaticGroupDNsfromMemberDNFilter", "value") 
set("StaticMemberDNAttribute", "value") 
set("ControlFlag", "value") 
set("UserFromNameFilter", "value") 
set("Credential", "value") 
set("GroupFromNameFilter", "value") 

startEdit() 
save() 
activate(block="true") 
0

我永远在线使用,但WLST脱机版将附带WebLogic安全提供商合作,而不是与自定义提供。当然,NovelAuthenticator自带了WebLogic,所以它应该可以工作。

尝试

realm = cmo.getSecurityConfiguration().getDefaultRealm() 
myProvider = realm.createAuthenticationProvider("weblogic.security.providers.authentication.NovellAuthenticator") 
相关问题