edit()
startEdit()

realm = cmo.getSecurityConfiguration().getDefaultRealm()
pwdvalidator = realm.lookupPasswordValidator('systemPasswordValidator')

if pwdvalidator:
print 'Password Validator provider is already created'

else:
# Create SystemPasswordValidator
syspwdValidator = realm.createPasswordValidator('systemPasswordValidator',
'com.bea.security.providers.authentication.passwordvalidator.SystemPasswordValidator')
print "--- Creation of system Password Validator succeeded!"
 
# Configure SystemPasswordValidator
try:
pwdvalidator.setMinPasswordLength(8)
pwdvalidator.setMaxPasswordLength(12)
pwdvalidator.setMaxConsecutiveCharacters(3)
pwdvalidator.setMaxInstancesOfAnyCharacter(4)
pwdvalidator.setMinAlphabeticCharacters(1)
pwdvalidator.setMinNumericCharacters(1)
pwdvalidator.setMinLowercaseCharacters(1)
pwdvalidator.setMinUppercaseCharacters(1)
pwdvalidator.setMinNonAlphanumericCharacters(1)
pwdvalidator.setRejectEqualOrContainUsername(true)
pwdvalidator.setRejectEqualOrContainReverseUsername(true)
print " --- Configuration of SystemPasswordValidator complete ---"
except Exception,e:
print e

</p>

</p>

save()
activate()

</p>

 

Ref:

http://download.oracle.com/docs/cd/E12840_01/wls/docs103/secmanage/atn.html

转载请注明:WebLogic Android 博客 » 使用WLST配置WebLogic密码策略