Solved

WebSphere Server v6.1 in Rational Application Developer 7

Posted on 2009-04-13
8
956 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
Comment Utility
Please define what you mean by "update a J2C Authentication element"...
0
 
LVL 41

Expert Comment

by:HonorGod
Comment Utility
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
Comment Utility
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
 
LVL 41

Expert Comment

by:HonorGod
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 2

Author Comment

by:Taplar
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now