Example: Configuring new J2C authentication data entries using wsadmin
An example configuring new J2C authentication data entries follows:
- Identify the parent ID and assign it to the security variable.
Using Jacl:
set security [$AdminConfig getid /Security:mysecurity/]
Using Jython:
security = AdminConfig.getid('/Security:mysecurity/')
- Identify the required attributes:
Using Jacl:
$AdminConfig required JAASAuthData
An example of this output follows:
Attribute Type alias String userId String password String
Using Jython:
print AdminConfig.required('JAASAuthData')
- Set up the required attributes:
Using Jacl:
set alias [list alias myAlias] set userid [list userId myid] set password [list password secret] set jaasAttrs [list $alias $userid $password]
An example of this output follows:
{alias myAlias} {userId myid} {password secret}
Using Jython:
alias = ['alias', 'myAlias'] userid = ['userId', 'myid'] password = ['password', 'secret'] jaasAttrs = [alias, userid, password]
An example of this output follows:
[[alias, myAlias], [userId, myid], [password, secret]]
- Create JAAS authentication data:
Using Jacl:
$AdminConfig create JAASAuthData $security $jaasAttrs
An example of this output follows:
(cells/mycell/nodes/mynode:resources.xml#JAASAuthData_2)
Using Jython:
print AdminConfig.create('JAASAuthData', security, jaasAttrs)
- Save the changes with the following command:
Using Jacl:
$AdminConfig save
Using Jython:
AdminConfig.save()