Solved

WebSphere Server v6.1 in Rational Application Developer 7

Posted on 2009-04-13
8
962 Views
Last Modified: 2013-12-14
Hello,

  I'm wanting to know if anyone knows if there is a way to update a J2C Authentication element for a server/profile without actually having to start the server first.
0
Comment
Question by:Taplar
  • 5
  • 3
8 Comments
 
LVL 41

Expert Comment

by:HonorGod
ID: 24137513
Please define what you mean by "update a J2C Authentication element"...
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 24138160
It may be possible using scripting.  But I would need more information before being able to say exactly how.

wsadmin tool:
  http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/rxml_commandline.html

Scripting the application serving environment
  http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/welc6topscripting.html
0
 
LVL 2

Author Comment

by:Taplar
ID: 24146972
Update the password for the element.  I'm running it in RAD 7 and I have to start the server, run the admin console, navigate to the J2C nodes and update the password, and then restart the server.  Where as older versions of WAS you could update the password and then start your server.  I want to be able to update the password without starting the server.  I found the file which the password is stored in for the node, but it was of course an encrypted form of it so I couldn't just update it there.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 41

Expert Comment

by:HonorGod
ID: 24147656
I might be able to help if you can tell me the exact sequence of actions used on the admin console to make this change.

I presume that after making the change, you have to use the "save" link.
If, before you do this, you use the "Review" link to display the xml files that will get changed.  Then, before you "save", open a command prompt, and "cd" to the directory containing the file(s) to be modified, and make a backup copy.

Then, do the save, and "compare" the before and after files, and let me know what tags & attributes changed.

Does that make sense?
0
 
LVL 2

Author Comment

by:Taplar
ID: 24150239
File Differences:
1)<authDataEntries> changed with a new password hash in the password attribute.

Actions in Admin Console:
1) Clicked left menu option "Security" to expand tree and clicked tree link "Secure administration, applications, and infrastructure"
2) In right window, in the area labeled "Authentication", clicked the plus box next to "Java Authentication and Authorization Service" and clicked tree link "J2C authentication data".
3) From the resulting list, clicked the Alias of which I wanted to update the password for.
4) Change password, Click Apply and then saved.
0
 
LVL 41

Accepted Solution

by:
HonorGod earned 500 total points
ID: 24150753
Yes...

copy the attached file to your WebSphere\AppServer\bin directory as showAsDict.py
open a command prompt
"cd" to the WebSphere AppServer bin directory
e.g., "cd \IBM\WebSphere\AppServer\bin
execute the wsadmin utility using something like:

wsadmin -conntype none -lang jython -profile showAsDict.py

At the wsadmin command prompt, enter:

print AdminConfig.list( 'Security' )

the output should be something like:

(cells/<nodeName>|security.xml#Security_1).  Assign this configID to a variable using:

security = AdminConfig.list( 'Security' )

Use the showAsDict() function to get easy access to the information using:

secDict = showAsDict( security )

The attribute in which we are interested is 'authDataEntries', so, we can see how many of these that we have:

print secDict[ 'authDataEntries' ]

on my system, I only have 1, so what I see is a single configID within square brackets.  To extract this configID I only need to:

authdata = secDict[ 'authDataEntries' ][ 1:-1 ]

Note: If you have more than one, and need my help with how to get the "right" one, please, let me know...

Now, I can display the attributes of the authentication data entry simply by using:

print AdminConfig.show( authdata )

and I can change the password value using:

AdminConfig.modify( authdata, '[[ password myNewPwd]]' )

and saving the changes:

AdminConfig.save()

and exiting wsadmin:

quit
--------------------------------------------------------------------------
So, the unannotated wsadmin commands that need to be issued, and which could be put into a Jython script file, if you want are:
--------------------------------------------------------------------------

security = AdminConfig.list( 'Security' )
secDict = showAsDict( security )
authdata = secDict[ 'authDataEntries' ][ 1:-1 ]
AdminConfig.modify( authdata, '[[ password myNewPwd]]' )
AdminConfig.save()



showAsDict.py.txt
0
 
LVL 2

Author Closing Comment

by:Taplar
ID: 31569621
I greatly appreciated this solution.  I wrote a function to do the commands so I could just execute the function with my new desired password and it updated it and everything.  Shared it with some other people on my team who also disliked the updation process as was.  Again, tyvm.
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 24158378
You are very welcome.  I'm glad to have been able to help.

Thanks for the grade & points.

Good luck & have a great day.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deletiā€¦
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question