admin@glassfish.java.net

Re: How can console pass a password or password alias to a command

From: Bill Shannon <bill.shannon_at_oracle.com>
Date: Tue, 16 Nov 2010 14:05:24 -0800

Joe Di Pol wrote on 11/16/10 11:40 AM:
> Anissa Lam wrote:
>>
>> What Ludo explained below is what i use to provide the "password alias"
>> feature in the console. This new console feature is in today's nightly build.
>> If you go to http://localhost:4848/management/domain/create-password-alias ,
>> you see that the parameter name is "AS_ADMIN_ALIASPASSWORD", so, I just pass
>> in "aliaspassword" as the key name for the password field when creating the
>> payload for this command.
>>
>> I guess you can define the the parameter as "AS_ADMING_SSHPASSWORD", and GUI
>> can pass the password to you the same way by specifying "sshpassword" as the
>> key in the payload thats sent to REST.
>
> I don't think I need to define a new parameter. create-node-ssh does:
>
> @Param(name = "sshpassword", optional = true, password = true)
> private String sshpassword;
>
> I think this means you should be able to use AS_ADMIN_SSHPASSWORD
> just like you did for create-password-alias.

Right.

In the URL can can use AS_ADMIN_SSHPASSWORD=<base64-encoded-value> or
sshpassword=<raw-value>.

Encoding the value doesn't do anything for security, but it does ensure that
any special characters don't cause problems. In the other case, I would
assume the value is URL-encoded.