You need to create a change-set containing basic authentication parameters. This change-set could then point to the change-set hosted in guvnor (or any of its resources). Here is an example of a change-set using basic authentication pointing to a package resource:<div>

<br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8">&lt;change-set&gt; <br>    &lt;add&gt; <br>        &lt;resource source=&#39;<a href="http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST">http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST</a>&#39;  <br>

type=&#39;PKG&#39; <b>basicAuthentication=&quot;enabled&quot; username=&quot;admin&quot; password=&quot;admin&quot; </b><br>/&gt; <br>    &lt;/add&gt; <br>&lt;/change-set&gt;<div><br clear="all">Best,</div><div><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>

<br>Esteban Aliverti<br>- Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com </a><br>- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>


<br><br><div class="gmail_quote">2010/10/27 developer researcher <span dir="ltr">&lt;<a href="mailto:java.developer.researcher@gmail.com">java.developer.researcher@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<span style="color:rgb(0, 0, 153)">     Hello,</span><br style="color:rgb(0, 0, 153)"><br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">     I am trying of </span><span style="color:rgb(0, 0, 153)" lang="en"><span title="">follow the instructions of: </span></span><span style="color:rgb(0, 0, 153)">1.4.8.1. The Knowledge Agent in &#39;<a href="http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-guvnor/html_single/index.html" target="_blank">http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-guvnor/html_single/index.html</a>&#39;</span><br style="color:rgb(0, 0, 153)">


<br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">     I see that after of create the snapshots are generated several URLs:</span><br style="color:rgb(0, 0, 153)"><br style="color:rgb(0, 0, 153)">
<span style="color:rgb(0, 0, 153)">- URL for package documentation</span><br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">- URL for package source</span><br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">- URL for package binary</span><br style="color:rgb(0, 0, 153)">


<span style="color:rgb(0, 0, 153)">- URL for running tests</span><br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">- Change Set: &#39;<a href="http://localhost:8383/drools-guvnor/org.drools.guvnor.Guvnor/package/org.examples/org.examples/ChangeSet.xml" target="_blank">http://localhost:8383/drools-guvnor/org.drools.guvnor.Guvnor/package/org.examples/org.examples/ChangeSet.xml</a>&#39;</span><br style="color:rgb(0, 0, 153)">


<br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">     I need consume a rule from a java application. I can download the file &#39;ChangeSet.xml&#39; using the credentials (user=&quot;admin&quot; and password=&quot;&quot;) but I get a HTTP 401 error </span><span style="color:rgb(0, 0, 153)" lang="en"><span title="">even when I use the same credentials in my code</span></span><span style="color:rgb(0, 0, 153)">. I attached the code and the exception.</span><br style="color:rgb(0, 0, 153)">


<br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)"> Thanks and regards,</span><br><br><div class="gmail_quote">2010/10/26 developer researcher <span dir="ltr">&lt;<a href="mailto:java.developer.researcher@gmail.com" target="_blank">java.developer.researcher@gmail.com</a>&gt;</span><div>

<div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><span style="color:rgb(0, 0, 153)">     </span><span style="color:rgb(0, 0, 153)" lang="en"><span title="">Hi all,<br>


<br>I am using Drools Guvnor </span></span><span style="color:rgb(0, 0, 153)" lang="en"><span title="">as follows:</span></span><br style="color:rgb(0, 0, 153)">
<br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">1º Security configuration:</span><div><br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">&lt;security:identity authenticate-method=&quot;#{defaultAuthenticator.authenticate}&quot;/&gt;</span><br style="color:rgb(0, 0, 153)">



</div><span style="color:rgb(0, 0, 153)"><div>&lt;security:role-based-permission-resolver enable-role-based-authorization=&quot;true&quot;/&gt;<br><br></div>2º User permission: an user as administrator with permissions of:<br>


- Analyst for &#39;category=examples&#39; <br>
- package.developer for &#39;package=org.examples&#39;<br><br></span><span style="color:rgb(0, 0, 153)" lang="en"><span title="">What additional configuration is needed to consume a rules from an application using a</span></span> &#39;<span style="color:rgb(0, 0, 153)">Knowledge Agent&#39;?</span><br style="color:rgb(0, 0, 153)">



<br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)" lang="en"><span style="background-color:rgb(230, 236, 249)" title="">Someone has an example or tutorial to use of &#39;Knowledge Agent&#39;?</span></span><br style="color:rgb(0, 0, 153)">



<br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)" lang="en"><span title="">I hope someone can help me in this issue that is critical to use drools in a real project. I </span></span><span style="color:rgb(0, 0, 153)" lang="en"><span title="">attached the related files</span></span><span style="color:rgb(0, 0, 153)">.</span><br>



<br><span style="color:rgb(0, 0, 153)">Thanks and regards,</span><br><br><div class="gmail_quote">2010/10/22 developer researcher <span dir="ltr">&lt;<a href="mailto:java.developer.researcher@gmail.com" target="_blank">java.developer.researcher@gmail.com</a>&gt;</span><div>


<div></div><div><br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><span style="color:rgb(0, 0, 153)">Hello Michael,</span><br style="color:rgb(0, 0, 153)">

<br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">I included the code for authentication but occurs a new exception. I think that is by configuration of Guvnor.</span><br style="color:rgb(0, 0, 153)">


<br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">I attached the exception and the log of guvnor. </span><span style="color:rgb(0, 0, 153)" lang="en"><span title="">I hope you can help me.</span></span><br style="color:rgb(0, 0, 153)">




<br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">Thanks and regards,</span><br><br><div class="gmail_quote">2010/10/21 Michael Anstis <span dir="ltr">&lt;<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>&gt;</span><div>



<div></div><div><br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Hi,<div><br></div><div>#2</div><div><br></div><div>You could try setting the basicAuthentication, Username and Password properties on UrlResource before adding it to the builder:-</div>




<div><br></div><div><font face="&#39;courier new&#39;, monospace">&lt;snip&gt;</font></div>
<div><font face="&#39;courier new&#39;, monospace">    builder.add(ResourceFactory.newUrlResource(url), ResourceType.PKG);</font></div><div><font face="&#39;courier new&#39;, monospace">&lt;/snip&gt;</font></div>
<div><br></div><div><div><font face="&#39;courier new&#39;, monospace">&lt;snip&gt;</font></div><div><font face="&#39;courier new&#39;, monospace">    UrlResource urlResource = </font><span style="font-family:&#39;courier new&#39;,monospace">ResourceFactory.newUrlResource(url);</span></div>





<div><span style="font-family:&#39;courier new&#39;,monospace">    urlResource.setBasicAuthentication(&quot;enabled&quot;);</span></div><div><span style="font-family:&#39;courier new&#39;,monospace">    urlResource.setUsername(&quot;Smurf&quot;);</span></div>





<div><span style="font-family:&#39;courier new&#39;,monospace">    urlResource.setPassword(&quot;Smurfy&quot;);</span></div><div><font face="&#39;courier new&#39;, monospace">    builder.add(urlResource, ResourceType.PKG);</font></div>





<div><font face="&#39;courier new&#39;, monospace">&lt;/snip&gt;</font></div><div><font face="&#39;courier new&#39;, monospace"><br></font></div>When you shift to using change-sets you should be able to embed the basic authentication in the change-set.xml file (as per my previous link) - your example code isn&#39;t using KnowledgeAgent yet; simply a URL resource.</div>





<div><br></div><div><br><div class="gmail_quote">2010/10/21 developer researcher <span dir="ltr">&lt;<a href="mailto:java.developer.researcher@gmail.com" target="_blank">java.developer.researcher@gmail.com</a>&gt;</span><div>




<div></div><div><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<span style="color:rgb(0, 0, 153)">Hello Michael and Subhas, thanks for your answers.</span><br style="color:rgb(0, 0, 153)"><br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">Apparently the problem is due to permission. I am using the next configuration:</span><br style="color:rgb(0, 0, 153)">






<br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">&lt;security:identity authenticate-method=&quot;#{defaultAuthenticator.authenticate}&quot;/&gt;</span><br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">&lt;security:role-based-permission-resolver enable-role-based-authorization=&quot;true&quot;/&gt;</span><br style="color:rgb(0, 0, 153)">






<br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">I attached the class that use for my test, in this code not included code for authenticate. In that sense I have new questions:</span><br style="color:rgb(0, 0, 153)">






<br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">1º What is the minimal configuration of Guvnor for use the Knowledge Agent?</span><br style="color:rgb(0, 0, 153)"><br style="color:rgb(0, 0, 153)">



<span style="color:rgb(0, 0, 153)">2º What code should be included for authentication?</span><br style="color:rgb(0, 0, 153)"><br style="color:rgb(0, 0, 153)"><span style="color:rgb(0, 0, 153)">Thanks and regards,</span><br>






<br><div class="gmail_quote">2010/10/20 Subhas <span dir="ltr">&lt;<a href="mailto:subhas.sing@gmail.com" target="_blank">subhas.sing@gmail.com</a>&gt;</span><div><div></div><div><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">






Give some more details like code and jars in build path. I use KnowledgeBase and working fine for me.<br><br>Thanks,<br><font color="#888888">Subhas</font><div><div></div><div><br><br><div class="gmail_quote">On Wed, Oct 20, 2010 at 12:54 PM, java.developer.researcher <span dir="ltr">&lt;<a href="mailto:java.developer.researcher@gmail.com" target="_blank">java.developer.researcher@gmail.com</a>&gt;</span> wrote:<br>







<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div><div></div><div><br>
Hello,<br>
<br>
I am trying of integrate Drools Guvnor with an java web application. I am<br>
using KnowledgeAgent, but occurs the next exception when execute the code:<br>
<br>
java.lang.RuntimeException: java.io.IOException: Server returned HTTP<br>
response code: 401 for URL:<br>
<a href="http://localhost:8383/drools-guvnor/org.drools.guvnor.Guvnor/package/org.examples/org.examples" target="_blank">http://localhost:8383/drools-guvnor/org.drools.guvnor.Guvnor/package/org.examples/org.examples</a><br>








        at<br>
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:559)<br>
        at<br>
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)<br>
        at<br>
org.examples.test.TestKnowledgeAgent.getKnowledgeBase(TestKnowledgeAgent.java:63)<br>
        at<br>
org.examples.test.TestKnowledgeAgent.main(TestKnowledgeAgent.java:28)<br>
Caused by: java.io.IOException: Server returned HTTP response code: 401 for<br>
URL:<br>
<a href="http://localhost:8383/drools-guvnor/org.drools.guvnor.Guvnor/package/org.examples/org.examples" target="_blank">http://localhost:8383/drools-guvnor/org.drools.guvnor.Guvnor/package/org.examples/org.examples</a><br>








        at<br>
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)<br>
        at<br>
org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:76)<br>
        at<br>
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:512)<br>
        ... 3 more<br>
Exception in thread &quot;main&quot; java.lang.NullPointerException<br>
        at<br>
org.examples.test.TestKnowledgeAgent.main(TestKnowledgeAgent.java:37)<br>
<br>
     What is the cause of this exception? How can I solved it?<br>
<br>
Any help is welcome.<br>
<br>
</div></div>Regards,<br>
<font color="#888888">--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Use-Knowledge-Agent-tp1741354p1741354.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Use-Knowledge-Agent-tp1741354p1741354.html</a><br>








Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br>
</div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div></div></div><br><div style="display:inline"></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div></div></div><br></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div></div></div><br><div style="display:inline"></div>
</blockquote></div></div></div><br><div style="display:inline"></div>
</blockquote></div></div></div><br><div style="display:inline"></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br></div></div>