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 207955 - Useless Authentication Required dialog
Summary: Useless Authentication Required dialog
Status: VERIFIED WORKSFORME
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-31 15:42 UTC by Jiri Skrivanek
Modified: 2012-05-16 07:17 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
relevant call stack (3.31 KB, text/plain)
2012-04-24 00:19 UTC, David Konecny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2012-01-31 15:42:50 UTC
A dialog "Authentication Required" is displayed when you misspell password in Cloud properties. But it is not possible to log in using this dialog. To reproduce:

- right-click Oracle Cloud node and choose Properties
- change password to something invalid and close properties
- refresh Oracle Cloud node
- dialog "Authentication Required" with "User Name" and "Password" fields is opened
- provide valid credentials and click OK
- but dialog is opened again. You have to go back to properties panel and change password there.

Product Version: NetBeans IDE 7.1 (Build 201112071828)
Java: 1.7.0_02; Java HotSpot(TM) Client VM 22.0-b10
System: Windows XP version 5.1 running on x86; Cp1250; en_US (nb)
Comment 1 Petr Jiricka 2012-04-23 16:12:49 UTC
I also encountered this issue.
Comment 2 David Konecny 2012-04-24 00:19:37 UTC
Created attachment 118666 [details]
relevant call stack
Comment 3 David Konecny 2012-04-24 00:47:57 UTC
The problem here is that GlassFish installs global authentication dialog while in my case I expect exception back that the connection attempt failed. Could this be fixed on GlassFish side? What's the reason for a global handler? Is there a way to disable it for certain URLs for example?

Another thing which makes the dialog useless is that Oracle Public Cloud internally prefixes username with "<Identity Group>." so in our case the real username is "nbtrial.david.konecny@oracle.com". Weird but nothing we can do anything about.
Comment 4 David Konecny 2012-04-24 00:51:34 UTC
I'm increasing to P2 because whenever user ends up in this dialog there is not way for them to figure out correct username.
Comment 5 Vince Kraemer 2012-04-24 16:48:56 UTC
David: quick question...  if I turn off the GF authenticator, how will you work around the NbAuthenticator... or does it apply anymore?

see o.n.core/src/org/netbeans/core/GuiRunLevel.java and o.n.core/src/org/netbeans/core/NbAuthenticator.java
Comment 6 Vince Kraemer 2012-04-25 16:32:17 UTC
David... please let me know.  One other q.  Have you tried to disable the GF plugin and verify that you get the result you expect from a code change in the GF plugin?
Comment 7 David Konecny 2012-04-26 05:25:31 UTC
You are right - getting rid of glassfish.common.AdminAuthenticator puts in place netbeans.core.NbAuthenticator. API wise this is broken - the last authenticator wins.

On the other hand if Oracle Cloud team did not have such a creative idea of prefixing username with some secret this would not be a problem.

Oh well, I will try to workaround it by using reflection and resetting Authenticator.theAuthenticator whenever user is changing password and restore it afterwards.
Comment 8 David Konecny 2012-04-27 04:26:15 UTC
This is not a Beta stopper - Oracle Cloud is not publicly available yet.
Comment 9 David Konecny 2012-04-30 22:05:26 UTC
2acd07eb4610
Comment 10 Quality Engineering 2012-05-02 10:04:21 UTC
Integrated into 'main-golden', will be available in build *201205020400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/2acd07eb4610
User: David Konecny <dkonecny@netbeans.org>
Log: #207955 - Useless Authentication Required dialog
Comment 11 Jiri Skrivanek 2012-05-04 09:15:29 UTC
I am still able to reproduce when I call Refresh on "Oracle Cloud Remote" node.

Product Version: NetBeans IDE Dev (Build 201205030400)
Java: 1.7.0_04; Java HotSpot(TM) 64-Bit Server VM 23.0-b21
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
Comment 12 David Konecny 2012-05-15 01:10:29 UTC
> I am still able to reproduce when I call Refresh on "Oracle Cloud Remote" node.

Current fix is limited but I think it is enough:
* in wizard panel default authenticator is disabled and exception is handled correctly
* in properties dialog the problem is that customizer does not have its own Ok/Cancel button and therefore I cannot do the same as in wizard. Instead when dialog is being closed (JComponent.removeNotify()) the authenticator is disabled and password is tested (after properties panel was closed) and if the password is still wrong then a message box is shown few moments later.

In any case if user's password is wrong and they do refresh or any other action which triggers cloud communication that will always fail and result into default authenticator. It is not worth it to handle individually all the cases.
Comment 13 Jiri Skrivanek 2012-05-16 07:17:26 UTC
I agree with evaluation. Not so critical to cover all corner cases.