[rules-users] HTTP 401 Unauthorized when using KIE API on Workbench M2 repository

Patel, Ronak (Autonomy) ronak.patel at hp.com
Wed May 14 14:59:53 EDT 2014


Anyone have any ideas on this?

I have some new information: just to check if my preemptive authentication configuration in settings.xml worked at all, I set my KIE module as a dependency on a project and used command line Maven 3.2.1 to compile. It successfully authenticated with the Workbench Maven repository and downloaded the module into my local Maven repository. I had Fiddler log the HTTP requests and saw that the requests to the Workbench repo had the basic authentication request header, as I expected. So any ideas on why the request generated by the API (Aether?) wouldn't have this header? It seems like it's not picking up the preemptive authentication settings.

Thanks,

Ronak

From: Patel, Ronak (Autonomy)
Sent: Monday, May 12, 2014 5:01 PM
To: rules-users at lists.jboss.org
Subject: HTTP 401 Unauthorized when using KIE API on Workbench M2 repository

I'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.

  KieServices ks = KieServices.Factory.get();
  KieContainer kContainer = ks.newKieContainer(ks.newReleaseId("com.hp.pa.sample", "realestate", "LATEST"));

I've tried putting in my settings.xml file both suggestions in https://bugzilla.redhat.com/show_bug.cgi?id=1059584#c4 (also saw the preemptive one in https://bugzilla.redhat.com/show_bug.cgi?id=1037556 and other threads/forums and bug reports), but I continue to get the same error.

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

GET http://kiewbserver:8080/kie-drools-wb/maven2/com/hp/pa/sample/realestate/maven-metadata.xml HTTP/1.1
Host: kiewbserver:8080
Pragma: no-cache
Cache-Control: no-cache, no-store
Accept-Encoding: gzip
Connection: keep-alive
Connection: keep-alive
Accept: */*
User-Agent: Aether

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.

If I remove the authentication requirement from the Maven repository using the workaround described in bug 1059584 (referenced above), all my code works fine.

I followed the procedure to create a user for the Workbench on JBoss AS that is demonstrated in the start of this video: http://www.youtube.com/watch?v=vj3MNmiUnvY. That's the user whose credentials I've tried putting in my settings.xml. Is there anything else that needs to be done on the server side?

Any other ideas on what I may have missed or how to debug this further?

Thank you,

Ronak Patel
Software Designer
HP Autonomy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20140514/117cd1ee/attachment-0001.html 


More information about the rules-users mailing list