[jbosstools-issues] [JBoss JIRA] (JBIDE-12999) 2nd dialog with username and password on top of connection dialog if you use bad credentials

Andre Dietisheim (JIRA) jira-events at lists.jboss.org
Tue Nov 6 09:55:18 EST 2012


    [ https://issues.jboss.org/browse/JBIDE-12999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12732096#comment-12732096 ] 

Andre Dietisheim edited comment on JBIDE-12999 at 11/6/12 9:53 AM:
-------------------------------------------------------------------

The connection dialog is *UserValidationDialog*, It is invoked by *org.eclipse.ui.internal.net.auth.NetAuthenticator*. The NetAuthenticator is contributed by *org.eclipse.ui.net* plugin to the *org.eclipse.core.net.authenticator* extension point. *org.eclipse.core.internal.net.ProxyManager* is looking for extension to this extension-point and takes the first extension it finds:

{code}
private Authenticator getPluggedInAuthenticator() {
	IExtension[] extensions = RegistryFactory.getRegistry().getExtensionPoint(Activator.ID, Activator.PT_AUTHENTICATOR).getExtensions();
	if (extensions.length == 0)
		return null;
	IExtension extension = extensions[0];
	IConfigurationElement[] configs = extension.getConfigurationElements();
	if (configs.length == 0) {
		Activator.log(IStatus.ERROR, NLS.bind("Authenticator {0} is missing required fields", (new Object[] {extension.getUniqueIdentifier()})), null);//$NON-NLS-1$ 
		return null;
	}
	try {
		IConfigurationElement config = configs[0];
		return (Authenticator) config.createExecutableExtension("class");//$NON-NLS-1$ 
	} catch (CoreException ex) {
		Activator.log(IStatus.ERROR, NLS.bind("Unable to instantiate authenticator {0}", (new Object[] {extension.getUniqueIdentifier()})), ex);//$NON-NLS-1$ 
		return null;
	}
}
{code}

and registers it as Authenticator to the HttpUrlConnection:

{code}
private void registerAuthenticator() {
	Authenticator a = getPluggedInAuthenticator();
	if (a != null) {
		Authenticator.setDefault(a);
	}
}
{code}
                
      was (Author: adietish):
    The connection dialog is *UserValidationDialog*, It is invoked by *org.eclipse.ui.internal.net.auth.NetAuthenticator*. The NetAuthenticator is contributed by *org.eclipse.ui.net* plugin to the *org.eclipse.core.net.authenticator* extension point. *org.eclipse.core.internal.net.ProxyManager* is looking for extension to this extension-point and takes the first extension it finds:

{code}
	private Authenticator getPluggedInAuthenticator() {
		IExtension[] extensions = RegistryFactory.getRegistry().getExtensionPoint(Activator.ID, Activator.PT_AUTHENTICATOR).getExtensions();
		if (extensions.length == 0)
			return null;
		IExtension extension = extensions[0];
		IConfigurationElement[] configs = extension.getConfigurationElements();
		if (configs.length == 0) {
			Activator.log(IStatus.ERROR, NLS.bind("Authenticator {0} is missing required fields", (new Object[] {extension.getUniqueIdentifier()})), null);//$NON-NLS-1$ 
			return null;
		}
		try {
			IConfigurationElement config = configs[0];
			return (Authenticator) config.createExecutableExtension("class");//$NON-NLS-1$ 
		} catch (CoreException ex) {
			Activator.log(IStatus.ERROR, NLS.bind("Unable to instantiate authenticator {0}", (new Object[] {extension.getUniqueIdentifier()})), ex);//$NON-NLS-1$ 
			return null;
		}
	}
{code}

and registers it as Authenticator to the HttpUrlConnection:

{code}
private void registerAuthenticator() {
		Authenticator a = getPluggedInAuthenticator();
		if (a != null) {
			Authenticator.setDefault(a);
		}
	}
{code}
                  
> 2nd dialog with username and password on top of connection dialog if you use bad credentials
> --------------------------------------------------------------------------------------------
>
>                 Key: JBIDE-12999
>                 URL: https://issues.jboss.org/browse/JBIDE-12999
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: openshift
>    Affects Versions: 4.0.0.Beta1
>            Reporter: Andre Dietisheim
>            Assignee: Andre Dietisheim
>             Fix For: 4.0.0.CR1
>
>         Attachments: existing-connection-auth-dialog.png, new-connection-auth-dialog.png
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jbosstools-issues mailing list