Skip to main content

Glassfish and JDBC credentials encrypted

5 replies [Last post]
codecr
Offline
Joined: 2007-10-18

Hi!

one of our clients have a GF 2.1 running several applications. They are requesting that the password for each jdbc connection must be encrypted. Is that possible?? The target database are Oracle, MySql, MSSQL, DB2 and so on.

Best regards,
Gerardo

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sm157516
Offline
Joined: 2005-03-28

You could try the asadmin create-password-alias command. The domain.xml is updated with the aliased password.

asadmin create-password-alias --port 4848 --user admin --passwordfile /opt/password.txt oracle-alias

The domain.xml is updated like :

for the corresponding pool.

password.txt contents :

AS_ADMIN_PASSWORD=adminadmin (the password needed to start the domain or the administrative password)
AS_ADMIN_ALIASPASSWORD=mypassword (password that you need to encrypt ex:the database password that is stored in clear as of now in domain.xml that you want it replaced with alias)

bkrivensky
Offline
Joined: 2008-05-13

I am trying to add security to my mySQL connection password within domain.xml. I understand the create-password-alias is the option to use. I tried to do this and I get invalid user or password. Here is my command:
asadmin create-password-alias --user root mysqlalias

It comes back with two prompts to enter my original password. Each time I get an error.

sm157516
Offline
Joined: 2005-03-28

Did you try to use the passwordfile option as mentioned above?

bkrivensky
Offline
Joined: 2008-05-13

I just tried the passwordfile option and that worked. Thanks for your quick response. It did not update the domain.xml file with my alias. I updated the domain.xml file with the new alias and it works.

Do you know if Glassfish V3 has this feature built in? I'm using version 2.

sm157516
Offline
Joined: 2005-03-28

GlassFish V3 has the create-password-alias command too.