Chat with us, powered by LiveChat
Decrypt – Password de un datasource creado en WL – .py
Ideal state to offer the best customer service
19 junio, 2018
Installing WebLogic 12c and creating your first Cluster
11 julio, 2018

How to decrypt the datasource password created in Weblogic

Applies for (validated scenarios)::

Oracle WebLogic Server - Version 11.1x and higher:
JDK - Version 1.7x and higher
The information in this document applies to any platform

Purpose

Friends, We are going to do something very simple and practical: decrypt the password stored for a datasource in WebLogic Server.

Without more, we begin:

Step 1- We set environment variables

We do this by executing the setDomainEnv.sh script found insetDomainEnv.sh que se encuentra en

$DOMAIN_HOME/bin
as follows [the full path in my domain is:/u02/app/oracle/Middleware/12.2.1.3/Oracle_Home/user_projects/domains/clusterdemo1]

[oracle@apps bin]$ . ./setDomainEnv.sh 
[oracle@apps clusterdemo1]$

Step 2- We run our script to decrypt

In our particular case we execute it like this (at the end of this post you can see the contents of the script):

[oracle@apps scripts]$ java weblogic.WLST decrypdspwd.py 

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

password: oracless

Ready! In the same way you can use the encryption routine through the services provided by WL. SUCCESS!

Do you need more help?

Please contact us at soporte@rinnovocorp.com or leave us a message from our site [contact form]

Script content (.py)

from weblogic.security.internal import *
from weblogic.security.internal.encryption import *
 
 
password = "{AES}f7eMFPnALxR1Df+MMyhgELTNz7LuhQx9JHFtzwSO81E="
path = "/u02/app/oracle/Middleware/12.2.1.3/Oracle_Home/user_projects/domains/clusterdemo1"
encryptionService = SerializedSystemIni.getEncryptionService(path)
cService = ClearOrEncryptedService(encryptionService)
print "password: " + cService.decrypt(password)

Comments are closed.