[jbosstools-issues] [JBoss JIRA] (JBIDE-16133) No indication that management authentication fails

Rob Stryker (JIRA) jira-events at lists.jboss.org
Wed Nov 27 15:01:06 EST 2013


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

Rob Stryker commented on JBIDE-16133:
-------------------------------------

Hi Steven (and [~blafond]):

I think I need more information on your specific usecase. 

I've just tested with an EAP6.1 with the following usecase, and I'm not really able to replicate your issue of the logs filling up. If I use a clean workspace and start the remote server with an incorrect password, I definitely get a credentials dialog popping up. The only way the dialog doesn't show up is if I accidentally click "Never show this again". 

Unfortunately there's no UI for the "never show this again" button (oops), but the setting is stored as follows:

{code}
       public static final String NEVER_ASK_AGAIN_KEY = "org.jboss.ide.eclipse.as.ui.launch.credentials.neverAsk"; //$NON-NLS-1$

	IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(JBossServerUIPlugin.PLUGIN_ID);
		boolean ignore = prefs.getBoolean(NEVER_ASK_AGAIN_KEY, false);
{code}

So if you can try on a clean workspace, or reset that preference, it might fix your issue (or might not). 

Another possibility is that your remote server is not actually exposing its management port.  You'll have to ensure that the remote server was launched with args -Djboss.bind.address.management={yourHost}

For random management requests, a trace through my code indicates that each management request requires a IAS7ManagementDetails,  and the default impl of this interface is AS7ManagementDetails. 

The current implementation only requests credentials if the values stored in the server are empty, for example, an empty username setting or an empty password setting.  So long as there are values stored in the server, it will use them and *not* request credentials. 

A management request will only be asked for credentials *once* by the as7/wildfly  framework, so there's really not any elegant way for my code to tell the difference. 

In general, it is up to the caller of the management request (in this case, Teiid) to catch this exception thrown by the management service and to throw up the credential dialog. I'd be happy to work with you guys if you think there's another way, or if you can outline your usecase more deeply as to what exactly you guys are doing. But the main limitation here is that for any single management request, the IAS7ManagementDetails only gets 1 chance to get the credentials correct. This is a wildfly / as7 limitation, and ASTools does not currently have any api to make this easier, or to make multiple requests or poll if the request is wrong. 

You guys can implement IAS7ManagementDetails yourself and force it to always poll for credentials, but that will quickly become very annoying to the user as well, so I don't think that's the proper solution. 

I think the best solution for you guys is to catch the credentialing exception, open the credential dialog, and then re-post your management command. 

{code}
		} catch (Exception e) {
			Throwable root = getRootException(e);
			// If the exception is one that autnentication failed, re-prompt.
			if(root != null && root.getMessage() != null && root.getMessage().startsWith("Authentication failed:")) //$NON-NLS-1$
				provideCredentials(null);
{code}

To open the credential dialog, you can use the following api:
{code}
PollThreadUtils.requestCredentialsSynchronous(serverProvider, requiredProperties);
{code}

One final option is you can implement IAS7ManagementDetails in such a way that each IAS7ManagementDetails is used only once, but if one is used twice, you open the credential dialog. Then in your code, you would need to catch the credentialing exception, and issue the command again using the same IAS7ManagementDetails instance. 

Let me know if you guys need any more help. 
                
> No indication that management authentication fails
> --------------------------------------------------
>
>                 Key: JBIDE-16133
>                 URL: https://issues.jboss.org/browse/JBIDE-16133
>             Project: Tools (JBoss Tools)
>          Issue Type: Quality Risk
>          Components: server
>            Reporter: Steven Hawkins
>            Assignee: Rob Stryker
>            Priority: Critical
>             Fix For: 4.1.1.CR1
>
>
> Running Developer Studio 7.1.0.CR1 and using either the server auto-detection or manually defining a server and using an incorrect management password results in a console log entry:
> 14:00:54,966 ERROR [org.jboss.remoting.remote.connection] (Remoting "..." read-1) JBREM000200: Remote connection failed: java.io.IOException: Connection reset by peer
> On server startup without any indication of what it means.

--
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