Thursday, October 20, 2011

Use WLST script without clear text user/password

If you want to connect with wlst against a WebLogic domain without providing username and password in clear text, you can generate an user configuration file with encrypted credentials in it:

C:\...\wlserver_10.3\common\bin>wlst
wls:/offline> connect(url='t3://localhost:7001')
Please enter your username :weblogic
Please enter your password :********
Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'soa'.
wls:/soa/serverConfig> storeUserConfig()
Creating the key file can reduce the security of your system...
Do you want to cre
ate the key file? y
The username and password that were used for this WebLogic Server connection are stored in
C:\Users\<user
>/<user>-WebLogicConfig.properties and
C:\Users\
<user>/<user>-WebLogicKey.properties.

The WebLogicKey.properties file now contains a key and the WebLogicKey.properties file the encrypted credentials. You'll find both in your user's hone directory. Now you can connect with wlst without providing credentials, but keep an eye on these files!

No comments:

Post a Comment