users@glassfish.java.net

Re: Change the master-password using a java class or a configuration file

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Tue, 03 Jan 2012 10:05:40 -0600

I'm not sure what you mean by changing it via a configuration file. It
is possible to change the master password using asadmin and an password
input file, such that it doesn't prompt. For example, if you have the
file "pw" with the following content:

AS_ADMIN_MASTERPASSWORD=changeit
AS_ADMIN_NEWMASTERPASSWORD=abc123

then you can use:

asadmin --passwordfile pw change-master-password

to change the master password without any interaction from the user.

There is no public GlassFish Java class interface for changing the
master password. There are internal classes such as PEDomainsManager
that have methods for changing the master password, however, these
classes are subject to change in any release.

The master password is used as the key to the keystores used by
GlassFish, specifically the "domain-passwords", "cacerts.jks", and
"keystore.jks" files. These are all Java KeyStore files, so the KeyStore
class can be used to change the files' password. However, this storage
method is an implementation detail that can change with any release.

Tom