In today’s article, we will solve the problem of preventing our java application server from asking us for a password again and again with the Weblogic Boot.Properties Decrypt process.
With this file, we do not have to deal with entering a username and password while our services are standing up.
Sometimes it is necessary to access the username and password of the server in a new client or in any other way.
In such cases, you can follow the steps below for Decrypt.
First, let’s see where the domain is.
Command :
1 | ps auxwww | grep Name=AdminServer | tr ” ” “\n” | grep “domain.home” |
Output :
1 | -Ddomain.home=/u01/app/oracle/product/Middleware/user_projects/domains/base_domain |
1 2 3 | export DOMAIN_HOME=/u01/app/oracle/product/Middleware/user_projects/domains/base_domain source $DOMAIN_HOME/bin/setDomainEnv.sh |
1 2 3 | USR=`grep username $DOMAIN_HOME/servers/AdminServer/security/boot.properties | sed -e “s/^username=\(.*\)/\1/”` PW=`grep password $DOMAIN_HOME/servers/AdminServer/security/boot.properties | sed -e “s/^password=\(.*\)/\1/”` |
Sample Output;
1 2 3 4 5 | mshannon@slc05elc% echo $USR {AES}RI+L8BLQQc3mTwbCx59un+vcHJ4c30GMQ90ovDY7VLI= mshannon@slc05elc% echo $PW {AES}B9acQuaVUBNqsem1FzGROqu7w2tqZenm3StwYB3C+bM= |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | cat > /tmp/Decrypt.java <<EOF public class Decrypt { public static void main(String[] args) { System.out.println(“Decrypted value: ” + new weblogic.security.internal.encryption.ClearOrEncryptedService( weblogic.security.internal.SerializedSystemIni.getEncryptionService(args[0])). decrypt(args[1])); } } EOF $JAVA_HOME/bin/javac -d /tmp /tmp/Decrypt.java $JAVA_HOME/bin/java -cp /tmp:$CLASSPATH Decrypt “$DOMAIN_HOME” “$USR” $JAVA_HOME/bin/java -cp /tmp:$CLASSPATH Decrypt “$DOMAIN_HOME” “$PW” |
Finally :
1 2 3 4 5 | mshannon@slc05elc% $JAVA_HOME/bin/java -cp /tmp:$CLASSPATH Decrypt “$DOMAIN_HOME” “$USR” Decrypted Değer: weblogic mshannon@slc05elc% $JAVA_HOME/bin/java -cp /tmp:$CLASSPATH Decrypt “$DOMAIN_HOME” “$PW” Decrypted Değer: welcome1 |