Weblogic has a nice feature where you can dump out login keys. These keys can be used within WLST script to login without a password. This can be handy for automated tasks.
Generate the files
This is basically a one liner WLST script that will generate the keyfiles for the weblogic user. Adjust the script to fit your needs. This was done for 11g, but the same can be done for 12c – Just change the port from 7001 to 9500.
connect('weblogic', 'Password123', 't3://localhost:7001') storeUserConfig('/home/oracle/wlst/security/configfile.secure','/home/obiee/wlst/security/keyfile.secure') disconnect() exit()
I will just show how to use the keys within the WLST
connect() statement. The rest of your code remains the same. Once again this is written for 11g, but works the same for 12c – Just change the ports.
connect(userConfigFile='/home/obiee/wlst/security/configfile.secure',userKeyFile='/home/obiee/wlst/security/keyfile.secure',url='t3://localhost:7001') # rest of your code here