<div dir="ltr"><div><div><div>Max,<br><br></div>see <a href="https://github.com/jbossas/jboss-as/pull/4349">https://github.com/jbossas/jboss-as/pull/4349</a><br><br>--<br></div><div>tomaz<br></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Apr 9, 2013 at 1:01 PM, Max Rydahl Andersen <span dir="ltr">&lt;<a href="mailto:manderse@redhat.com" target="_blank">manderse@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This is cool - how does the authentication work/not work ?<br>
<br>
Found this on github:<br>
&quot;It requires a patched AS7 instance if not running on the same host.<br>
Some browsers require extra steps to get the authentication working, but Firefox should work out of the box.&quot;<br>
<br>
<a href="http://haraldpehl.blogspot.de/2013/03/independent-jboss-admin-console.html" target="_blank">http://haraldpehl.blogspot.de/2013/03/independent-jboss-admin-console.html</a> explains it a bit but<br>
what is the patch needed for AS7 and with all these quirks do you think we can make it portable/usable for<br>
writing a webapp that connects remotely ?<br>
<span class="HOEnZb"><font color="#888888"><br>
/max<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Tue, Apr 09, 2013 at 08:11:59AM +0200, Heiko Braun wrote:<br>
&gt;Here&#39;s a code sample:<br>
&gt;<br>
&gt;<br>
&gt;&lt;script&gt;<br>
&gt;// access EC2 demo instance<br>
&gt;http = new XMLHttpRequest();<br>
&gt;http.withCredentials = true;<br>
&gt;http.open(&quot;POST&quot;, &quot;<a href="http://as7-preview.dyndns.org:9990/management" target="_blank">http://as7-preview.dyndns.org:9990/management</a>&quot;, true);<br>
&gt;<br>
&gt;// async response handler<br>
&gt;http.onreadystatechange =function()<br>
&gt;{<br>
&gt;    if (http.readyState==4 &amp;&amp; http.status==200)<br>
&gt;    {<br>
&gt;        // decode response<br>
&gt;        response = dmr.ModelNode.fromBase64(http.responseText);<br>
&gt;        alert(response.get(&quot;result&quot;).asString());<br>
&gt;    }<br>
&gt;}<br>
&gt;<br>
&gt;// content type headers for DMR API<br>
&gt;http.setRequestHeader(&quot;Content-type&quot;,&quot;application/dmr-encoded&quot;);<br>
&gt;http.setRequestHeader(&quot;Accept&quot;,&quot;application/dmr-encoded&quot;);<br>
&gt;<br>
&gt;// create an operation<br>
&gt;op = new dmr.ModelNode();<br>
&gt;op.get(&quot;operation&quot;).set(&quot;read-attribute&quot;);<br>
&gt;op.get(&quot;address&quot;).setEmptyList();<br>
&gt;op.get(&quot;name&quot;).set(&quot;release-version&quot;);<br>
&gt;<br>
&gt;// send as base64 encoded<br>
&gt;http.send(op.toBase64String());<br>
&gt;<br>
&gt;&lt;/script&gt;<br>
&gt;<br>
&gt;<br>
&gt;On Apr 8, 2013, at 1:20 PM, Heiko Braun &lt;<a href="mailto:hbraun@redhat.com">hbraun@redhat.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; If you want to use the DMR API form plain JS and need all the typing build in, the dmr.js might be your friend:<br>
&gt;&gt;<br>
&gt;&gt; <a href="https://github.com/hal/dmr.js" target="_blank">https://github.com/hal/dmr.js</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Regards, Heiko<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; jboss-as7-dev mailing list<br>
&gt;&gt; <a href="mailto:jboss-as7-dev@lists.jboss.org">jboss-as7-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/jboss-as7-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/jboss-as7-dev</a><br>
&gt;<br>
<br>
&gt;_______________________________________________<br>
&gt;jboss-as7-dev mailing list<br>
&gt;<a href="mailto:jboss-as7-dev@lists.jboss.org">jboss-as7-dev@lists.jboss.org</a><br>
&gt;<a href="https://lists.jboss.org/mailman/listinfo/jboss-as7-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/jboss-as7-dev</a><br>
<br>
_______________________________________________<br>
jboss-as7-dev mailing list<br>
<a href="mailto:jboss-as7-dev@lists.jboss.org">jboss-as7-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/jboss-as7-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/jboss-as7-dev</a><br>
</div></div></blockquote></div><br></div>