Search code examples
glassfish

Change GlassFish's master password via its REST interface


I try to setup a GlassFish server via its REST interface.

Among other things I change JVM options

curl 
  -X PUT 
  -H 'Accept: application/json' 
  -H 'X-Requested-By: someone' 
  -d "-Xmx6000m" 
  http://localhost:4848/management/domain/configs/config/server-config/java-config/jvm-options

and change the admin password

curl 
  -X POST 
  -H 'Accept: application/json' 
  -H 'X-Requested-By: someone' 
  -d id=admin 
  -d password= 
  -d newpassword=helloworld 
  http://localhost:4848/management/domain/change-admin-password

Now I would like to change the master password too, but I did not find any hint how to do that by REST interface (apart from using asadmin change-master-password).

Does anyone know if is possible to change the master password via GlassFish's REST interface?


Solution

  • It's not possible to run the change-master-password command via the REST endpoint. It's because this command requires that the server is stopped and is executed locally against GlassFish installation. You should run this command via asadmin before you start the GlassFish domain.