admin@glassfish.java.net

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

From: Anissa Lam <anissa.lam_at_oracle.com>
Date: Tue, 16 Nov 2010 10:58:23 -0800

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 see the --sshpassword parameter now though.

Usage: asadmin [asadmin-utility-options] create-node-ssh --nodehost
<nodehost>
     [--installdir <installdir(default:${com.sun.aas.productRoot})>]
     [--nodedir <nodedir>] [--sshport <sshport(default:22)>]
     [--sshuser <sshuser(default:${user.name})>] [--sshkeyfile <sshkeyfile>]
     [--force[=<force(default:false)>]] [-?|--help[=<help(default:false)>]]
     name

Anissa.

On 11/16/10 10:29 AM, Joe Di Pol wrote:
>
> Ludo,
>
> Does this mean everything is there for Anissa to pass the sshpassword
> parameter to create-node-ssh? Or is there some work that needs to
> be done on the command or REST layers.
>
> Joe
>
>
> ludovic champenois wrote:
>> On 11/16/2010 08:21 AM, Tom Mueller wrote:
>>> Can the REST interface write the password to a temporary file, and
>>> pass in the --passwordfile option?
>>>
>> On the REST payload, we pass a map of k v (multiple v possible), and
>> when k is a cli param which is defined as password, here is the rule:
>> if the name of k is upper case and start with a prefix (can't
>> remember, ask Bill), the value has to be encoded on the client side.
>> But if instead of using K, you make it lower case and remove the
>> prefix, you can pass v as not encoded.
>> So Admin gui has a choice of passing( k,encodedvalue,) or( newk,
>> nonecodedvalue ).
>>
>> Since the design of admin gui and REST is such that later on, Admin
>> gui can run in a different vm than GF rest backend, we cannot rely on
>> a password file.
>>
>> Ludo
>>> Tom
>>>
>>> On 11/16/2010 10:15 AM, Joe Di Pol wrote:
>>>>
>>>> I'm looking at this bug:
>>>>
>>>> https://glassfish.dev.java.net/issues/show_bug.cgi?id=14710
>>>>
>>>> Basically we have a case where the console needs to pass
>>>> a password (or password alias) to a remote command.
>>>> create-node-ssh defines the sshpassword option as:
>>>>
>>>> @Param(name = "sshpassword", optional = true, password = true)
>>>> private String sshpassword;
>>>>
>>>> This gives us the ability to get the password (or password alias)
>>>> via the password file. But how does the console pass this parameter
>>>> via REST?
>>>>
>>>> Is there something I need to do in the command? Or is this something
>>>> that needs to be handled via the REST layer?
>>>>
>>>> As a last resort I guess I could define a second hidden option
>>>> that is not defined "password = true", but was hoping for a
>>>> cleaner solution.
>>>>
>>>> Thanks,
>>>>
>>>> Joe
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>