03.05.2015 Views

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

# creating the new entry<br />

$AdminConfig create SSLConfig $security_root $ssl_entry repertoire<br />

# saving the configuration<br />

$AdminConfig save<br />

Creating a J2C authentication entry<br />

The following script is very similar to the previous one. This one will create a new<br />

J2C authentication entry for <strong>WebSphere</strong>.<br />

Example: D-5 newJ2Centry.jacl<br />

# create a new J2C authentication entry<br />

# set the security object<br />

set security_root [$AdminConfig list <strong>Security</strong>]<br />

# set the attributes for the new object<br />

set auth_alias [list alias "itsobankds_auth"]<br />

set auth_descr [list description "ITSOBank DataSource authentication alias"]<br />

set auth_userId [list userId "dbuser01"]<br />

set auth_password [list password "password"]<br />

# put the new object together<br />

set auth_entry [list $auth_alias $auth_descr $auth_userId $auth_password]<br />

# create the new object<br />

$AdminConfig create JAASAuthData $security_root $auth_entry<br />

# saving the configuration<br />

$AdminConfig save<br />

Assigning a J2C entry to a DataSource<br />

Once you have at least one J2C authentication entry in your system, you can<br />

assign it/them to certain objects such as DataSource.<br />

Example: D-6 assignJ2Centry.jacl<br />

# change authentication alias for DataSource<br />

# usage: wsadmin assignJ2Centry.jacl datasource_name alias_name<br />

# storing the parameters<br />

set ds_arg [lindex argv 0]<br />

set alias_arg [lindex argv 1]<br />

# finding the datasource based on name<br />

set datasources [$AdminConfig list DataSource]<br />

foreach datasource $datasources {if {[regexp $ds_arg $datasource]} { set<br />

datasource_root $datasource; break }}<br />

# modify the authentication alias attribute for the datasource<br />

$AdminConfig modify $datasource_root [list [list authDataAlias $alias_arg]]<br />

# saving the configuration<br />

$AdminConfig save<br />

Appendix D. Using wsadmin scripting for security configuration 519

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!