It is - setting the username/passwd in the ConfigurationClient should
do the trick.

I had a look into
org.apache.marmotta.client.clients.ConfigurationClient and
org.apache.marmotta.client.util.HTTPUtil, this is where I found the
warnings.

We updated HttpClient to 4.3 some time ago which changed the API, but
never followed up with all the usages in marmotta [1].

There are probably to strategies to fix the auth-issue:
* configure the HttpClient for "preemtive auth", so it sends the
auth-header right at the beginning, or
* implement a retry-strategy that reacts on 401 correctly (actually,
IMHO HttpClient should do so automatically)


Best,
Jakob

[1] https://issues.apache.org/jira/browse/MARMOTTA-406

On 27 October 2014 10:50, Fabian Cretton <fabian.cret...@hevs.ch> wrote:
> Do you mean that passing the user/pwd to the ClientConfiguration should be
> the correct way to do it ?
>
> And, more precisely, where is the use of a deprecated API of HttpClient ?
>
> thanks
> Fabian
>
>>>> Jakob Frank <ja...@apache.org> 27.10.2014 09:38 >>>
> Hi Fabian,
>
> while looking into the code for the data-import issue, I saw that we
> are using a deprecated API of HttpClient - maybe the authentication
> issue is related to that.
>
> Would be great if you could have a look into that and maybe provide a patch!
>
> Best,
> Jakob
>
>
> On 24 October 2014 13:56, Fabian Cretton <fabian.cret...@hevs.ch> wrote:
>> Hi,
>>
>> In a Marmotta module I am developping, I did use ImportClient to upload
>> data, and it did work fine.
>>
>> However, when changing Marmotta's security from "simple" to "restricted",
>> the ImportClient was failing with a 401.
>> I did try to pass a user/pwd to the ClientConfiguration(), but the error
>> persisted (I was passing the user and password as 'clear' strings, for
>> instance 'admin' and 'pass123').
>>
>> To make it work, I had make my own copy of the method
>> ImportClient.uploadDataset(), and pass the headerAuth received by my own
>> webservice to the post object: post.setHeader("Authorization",
>> headerAuth);
>>
>> I thus have two question:
>> - is that normal that the ImportClient was failing or did I do something
>> wrong
>> - if that was normal, would you want a new version of ImportClient that
>> could handle this ?
>>
>> thank you
>> Fabian
>>

Reply via email to