Let me begin with sample Training project where it runs with Online and Corporate training partitions. Here in this post we can configure security realm for each partition.
- Authenticator
- Role
- Identity Asserter
- Role Mapper
- Authorizer
- Adjucator
- Auditor
- Credential Mapper
- Certificate Path Provider
- Password Validator
| WebLogic Multi-tenancy - SecurityRealm configuration |
Lets make re-usable module so that everyone can use the function as it is. The changes could be in the main module only. Further simplification you could also move the values into a separate properties file.
def create_securityRealm4partition(realmName):
security = cmo.getSecurityConfiguration()
print 'realm name is ' + realmName
realm = security.createRealm(realmName)
# ATN
atnp = realm.createAuthenticationProvider('ATNPartition','weblogic.security.providers.authentication.DefaultAuthenticator')
atna = realm.createAuthenticationProvider('ATNAdmin','weblogic.security.providers.authentication.DefaultAuthenticator')
# IA
ia = realm.createAuthenticationProvider('IA','weblogic.security.providers.authentication.DefaultIdentityAsserter')
ia.setActiveTypes(['AuthenticatedUser'])
# ATZ/Role
realm.createRoleMapper('Role','weblogic.security.providers.xacml.authorization.XACMLRoleMapper')
realm.createAuthorizer('ATZ','weblogic.security.providers.xacml.authorization.XACMLAuthorizer')
# Adjudicator
realm.createAdjudicator('ADJ','weblogic.security.providers.authorization.DefaultAdjudicator')
# Auditor
realm.createAuditor('AUD','weblogic.security.providers.audit.DefaultAuditor')
# Credential Mapper
realm.createCredentialMapper('CM','weblogic.security.providers.credentials.DefaultCredentialMapper')
# Cert Path
realm.setCertPathBuilder(realm.createCertPathProvider('CP','weblogic.security.providers.pk.WebLogicCertPathProvider'))
# Password Validator
pv = realm.createPasswordValidator('PV', 'com.bea.security.providers.authentication.passwordvalidator.SystemPasswordValidator')
pv.setMinPasswordLength(8)
pv.setMinNumericOrSpecialCharacters(1)
def main():
connect("weblogic","welcome1","t3://192.168.33.100:6100")
edit()
startEdit()
create_securityRealm4partition('Online_Realm')
create_securityRealm4partition('Corporate_Realm')
save()
activate()
disconnect()
main()
wlst createSecurityRealm.py
| Configure Security realm for partitions using WLST Script createSecurityRealm.py |
On the other hand you can see the WebLogic Admin console output as well:
| Security Realm on Domain Partition |
This article is a series of blog posts you will be more excited to see the next posts see below: