This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 113677 - Installer always provides userName as admin to glassfish-V2 server regarless a different userName was selected
Summary: Installer always provides userName as admin to glassfish-V2 server regarless ...
Status: NEW
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Vince Kraemer
URL:
Keywords:
: 116742 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-08-23 23:27 UTC by davisn
Modified: 2009-05-25 21:05 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
adding server gf v2 (domain1) with start and stop (14.43 KB, text/plain)
2007-08-27 13:02 UTC, nouar38
Details

Note You need to log in before you can comment on or make changes to this bug.
Description davisn 2007-08-23 23:27:13 UTC
-If select userName other than admin for installing glassfish V2 with Netbean, the IDE does not know the that user. 

STEPS TO REPRODUCE:
1. Install Netbean build 08/21/2007 with glassfish V2 > select userName=j2eetest and Password=j2eetest for Glassfish V2
server
2. Open IDE > expand Servers > right-click GlassFish V2 > select Properties 
BUG:
    It appears that:
    Username: admin and Password: (probably adminadmin)
Comment 1 Nitya Doraisamy 2007-08-24 20:29:52 UTC
The plugin seems to be assuming default username/password values when registering the default domain as part of
installation. Think it is a carryover from previous installations flow where user did not configure the default domain.

Investigating
Comment 2 nouar38 2007-08-27 11:50:08 UTC
200708261200 & GF v2 b58c bundled: windows xp

Did the same test described by Davis.

1. Install Netbean build 200708261200 (NetBeans Java EE download) which has GlassFish V2 b58c bundled
in the Installer wizard:
change userName=admin to testadmin and password=adminadmin to testadmin

2. Open IDE > expand Servers > right-click GlassFish V2 > select Properties 
BUG:
    It appears that:
    Username: admin and Password: (probably adminadmin)

added this step:
3. Start the instance:

will get the ide-window authentication with user and password form
change admin -> testadmin
add in password -> testadmin

in Glassfish V2-output can see the message
<<
Application server startup complete
SEC5046: Audit: Authentication refused for [admin]
Web login failed: Login failed: javax.security.auth.login.LoginException: Failed file login for admin.
>>

when the username and password is given as expected can see the change in start status and in 
Servers/GlassFish V2/Connection: Username: testadmin

This happens only for the "GlassFish V2" node auto-registered at IDE start (default domain with known location for the
IDE-Installer-gf build bundled hard-coded value with GF build)
C:\Program Files\glassfish-v2-b58c next build will be C:\Program Files\glassfish-v2-b58d



Comment 3 nouar38 2007-08-27 13:02:35 UTC
Created attachment 47456 [details]
adding server gf v2 (domain1) with start and stop
Comment 4 Vince Kraemer 2007-08-28 22:38:16 UTC
where does the installer save the data that the user enters on GF configuration page?

what is the format of the file?

It looks like the plugin expects a dot-asadminprefs file.

The file is a java property file, with at least two entries...

AS_ADMIN_USER=<admin user name>
AS_ADMIN_PASSWORD=<the admin password>

The file should be in the user.home directory...

If this file isn't provided, there is little the plugin can do to guess the correct non-default admin username or password.

If the file's path and/or format has changed... please forward that information so this can be resolved...
Comment 5 dlipin 2007-08-29 08:47:09 UTC
Vince,

the installer doesn`t store the data such as username/password for glassfish anywhere.
The only thing installer does about the glassfish - it creates the domain.

If I am not mistaken, the format of ~/.asadminpass is different from what you said.

As I see in my file, it contains several lines similar to the following:
asadmin://admin@localhost:4848 YWRtaW5hZG1pbg==

I checked with the latest glassfish build - this file is not recreated (if deleted) on the domain creation.

There is also ~/.asadmintruststore that is created by glassfish itself. 
Possibly it store some data as well but I can`t say for sure.

I can say that this strategy has not changed from NetBeans 5.5 times.
I can also say that after starting the domain I can login using its admin console (in the browser) with the specified 
user/password (j2eetest) but I can`t start glassfish in netbeans without LoginException exception.

If I am not mistaken, after starting the domain it asks for username and password and even I type there j2eetest/
j2eetest it shows the following lines in the log:
SEC5046: Audit: Authentication refused for [admin].
Web login failed: Login failed: javax.security.auth.login.LoginException: Failed file login for admin.

Why is it try to login with "admin" username - I don`t know, possibly it`s the plugin`s issue and not definitely the 
installer`s one.
Comment 6 Vince Kraemer 2007-08-29 18:01:36 UTC
Yes.  the issue is a plugin issue.

The installer doesn't provide any info about what the user choose for username and password... so we guess
admin/adminadmin...

If the installer DID write a file with the data that the user entered on the installer's 'install glassfish' wizard
page... the plugin could get it and use it to resolve this issue.

Based on your response, I have to assume that you do not want to provide the data to the plugin.

that makes this issue extremely difficult to resolve.
Comment 7 Vince Kraemer 2007-08-30 16:20:42 UTC
We have to assume that the user is trying to make their environment a bit secure.

That implies the custom username and password should not be stored in the server registration.

If we want to prevent the "default" data from being stored in the server registration, we could probably use another
system property that would be used as a flag to the default instance registration code that fires when the IDE is
started for the first time...

The installer would need to add this special flag to the netbeans.conf file...

Since putting bad authentication data into the registration is functionally equivalent to putting no authentication data
into the registration, I am going to lower this issue to p3.
Comment 8 Vince Kraemer 2007-09-12 23:29:39 UTC
solution design: 

Implement with TWO properties

org.netbeans.modules.j2ee.sun.ide.installUsername: The property that gets checked to find out the admin user name for
the GF domain that was created when NetBeans was installed.  If this property is not set the default value of "admin" is
assumed. If the property is set, the value is used as the admin username.

org.netbeans.modules.j2ee.sun.ide.nonDefaultPassword: This property is checked to see if the user set the value of the
admin password to something OTHER THAN adminadmin.  If the value of this boolean property is "true", then the
auto-registered instance gets registered with a blank password value...  the user will have to provide it when the
authorization dialog pops up.  If the property isn't true, the domain is auto-registered with the password 'adminadmin'
Comment 9 Vince Kraemer 2007-09-26 06:25:33 UTC
*** Issue 116742 has been marked as a duplicate of this issue. ***
Comment 10 Vince Kraemer 2007-09-28 22:06:32 UTC
read the user name and password data out of the $HOME/.nbi/registry.xml file and use it.
Comment 11 Vince Kraemer 2008-10-18 03:41:02 UTC
this doesn't apply to v3... lowering to p5
Comment 12 Vince Kraemer 2008-12-24 21:58:25 UTC
examine after 7.0