Thursday, 6 February 2014

Portal Scripting - Configuring new Java 2 Connector authentication data entries using scripting

Configuring new Java 2 Connector authentication data entries using scripting
----------------------------------------------------------------------------

1. Identify the parent ID:
security = AdminConfig.getid('/Cell:TIT-JAVA-010Cell/Security:/')
print security

2. Get required attributes:
print AdminConfig.required('JAASAuthData')

3. Set up required attributes:
alias = ['alias', 'myCustomAlias']
userid = ['userId', 'root']
password = ['password', 'admin']
jaasAttrs = [alias, userid, password]
print jaasAttrs

4. Create JAAS auth data:
print AdminConfig.create('JAASAuthData', security, jaasAttrs)

5. Save changes
AdminConfig.save()


When we try to establish connection below exception is showing up;

The test connection operation failed for data source Custom Datasource on server WebSphere_Portal at node TIT-JAVA-010Node with the following exception: java.sql.SQLException: Access denied for user ''@'tit-java-010.tecnicsdev.com' (using password: NO) DSRA0010E: SQL State = 28000, Error Code = 1,045. View JVM logs for further details.

But if we go to created alias and once again type the same userid and password then it is connecting.

No comments:

Post a Comment