<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
I was working on getting support to connect to remote servers for
the JBoss AS 7 plugin. The management API's require a
javax.security.auth.callback.CallbackHandler. I originally had an
implementation that would prompt for the username and password to be
entered. The issue is that the ShellImpl locks on execution [1] with
the same lock on the promptWithCompleter [2]. This causes the prompt
on the CallbackHandler implementation to dead-lock.<br>
<br>
The workaround I've found is the promptSecret [3] does not seem to
block. There are other potential ways around this, but they
generally require the user to authenticate on each execution which
is not really desirable.<br>
<br>
This leads to a few questions:<br>
<ol>
<li>Should the promptSecret be blocking too?</li>
<li>Is there a better approach to getting the credentials?</li>
<li>Should the promptWithCompleter be blocking? (I haven't really
looked at the code enough to determine this)</li>
</ol>
<br>
<br>
[1]:
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/ShellImpl.java#L836">https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/ShellImpl.java#L836</a><br>
[2]: <a
href="https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/ShellImpl.java#L1337">https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/ShellImpl.java#L1337</a><br>
[3]:
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/ShellImpl.java#L1404">https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/ShellImpl.java#L1404</a>
<pre class="moz-signature" cols="72">--
James R. Perkins
JBoss by Red Hat</pre>
</body>
</html>