<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;
        font-weight:normal;
        font-style:normal;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">I&#8217;m having trouble authenticating to access the Workbench Maven repository through the KIE API (kie-ci). My code is the following and fails on the second line with an exception that says something like module not found. I see the more specific
 401 error in the local Maven repository in the resolver-status.properties file.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">&nbsp; KieServices ks = KieServices.Factory.<i>get</i>();</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">&nbsp; KieContainer kContainer = ks.newKieContainer(ks.newReleaseId(</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">&quot;com.hp.pa.sample&quot;</span><span style="font-size:10.0pt;font-family:Consolas;color:black">,
</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">&quot;realestate&quot;</span><span style="font-size:10.0pt;font-family:Consolas;color:black">,
</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">&quot;LATEST&quot;</span><span style="font-size:10.0pt;font-family:Consolas;color:black">));<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal">I&#8217;ve tried putting in my settings.xml file both suggestions in
<a href="https://bugzilla.redhat.com/show_bug.cgi?id=1059584#c4">https://bugzilla.redhat.com/show_bug.cgi?id=1059584#c4</a> (also saw the preemptive one in
<a href="https://bugzilla.redhat.com/show_bug.cgi?id=1037556">https://bugzilla.redhat.com/show_bug.cgi?id=1037556</a> and other threads/forums and bug reports), but I continue to get the same error.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I did some further investigation using Fiddler and I see that the credentials are not being included in the HTTP request the code sends for resources in the Workbench Maven repository. I was expecting the basic authentication header to
 be in here. The HTTP request always looks like this (server name changed for security reasons):<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.5pt;font-family:&quot;Lucida Console&quot;">GET http://kiewbserver:8080/kie-drools-wb/maven2/com/hp/pa/sample/realestate/maven-metadata.xml HTTP/1.1<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.5pt;font-family:&quot;Lucida Console&quot;">Host: kiewbserver:8080<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.5pt;font-family:&quot;Lucida Console&quot;">Pragma: no-cache<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.5pt;font-family:&quot;Lucida Console&quot;">Cache-Control: no-cache, no-store<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.5pt;font-family:&quot;Lucida Console&quot;">Accept-Encoding: gzip<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.5pt;font-family:&quot;Lucida Console&quot;">Connection: keep-alive<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.5pt;font-family:&quot;Lucida Console&quot;">Connection: keep-alive<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.5pt;font-family:&quot;Lucida Console&quot;">Accept: */*<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.5pt;font-family:&quot;Lucida Console&quot;">User-Agent: Aether<o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">And the response is a typical HTTP/1.1 401 Unauthorized with the standard JBoss error page as the body. Using the composer feature in Fiddler, if I issue this same request with the basic authentication header included, it works, returning
 an HTTP 200 response with the requested file.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">If I remove the authentication requirement from the Maven repository using the workaround described in bug 1059584 (referenced above), all my code works fine.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I followed the procedure to create a user for the Workbench on JBoss AS that is demonstrated in the start of this video:
<a href="http://www.youtube.com/watch?v=vj3MNmiUnvY">http://www.youtube.com/watch?v=vj3MNmiUnvY</a>. That&#8217;s the user whose credentials I&#8217;ve tried putting in my settings.xml. Is there anything else that needs to be done on the server side?<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Any other ideas on what I may have missed or how to debug this further?<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Thank you,<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black">Ronak Patel<br>
</span></b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#717172">Software Designer<br>
HP Autonomy</span><o:p></o:p></p>
</div>
</body>
</html>