hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexandre (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1650) Fluent Executor doesn't inherit auth scheme and creds provider of HttpClient instance
Date Tue, 26 May 2015 01:50:17 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14558610#comment-14558610
] 

Alexandre commented on HTTPCLIENT-1650:
---------------------------------------

[~olegk] I would be glad to submit a patch, however I'm not sure what would be the best solution
to that problem. It seems to me that there would be no way to resolve the crendentials from
the HttpClient instance, since there's no public getter for the creds provider (it seems there
was in the past with AbstractHttpClient).

>From what I can see by reading the source, the client.execute(request, context)  will
use the creds provider from the context if available, rather than the one configured on the
HttpClient. Since the fluent api always passes a context which is not derived directly from
the bound HttpClient instance, that would explain why it doesn't work like I expected.

"What is not OK is how HttpClient deals with system wide auth credentials for complex auth
schemes such as Win Native, SPNEGO, etc," - Could you expand a bit on this?

Depending on your answer, I'll either open an issue or try to submit a fix...

> Fluent Executor doesn't inherit auth scheme and creds provider of HttpClient instance
> -------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1650
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1650
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Fluent HC
>    Affects Versions: 4.4.1
>         Environment: Windows Server 2008
>            Reporter: Alexandre
>            Priority: Minor
>              Labels: flexibility
>             Fix For: 5.0
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> When instantiating an Executor from an existing HttpClient instance, the Executor doesn't
inherit the credentials provider.
> Executor(final HttpClient httpclient) {
>         super();
>         this.httpclient = httpclient;
>         this.credentialsProvider = new BasicCredentialsProvider();
>         this.authCache = new BasicAuthCache();
>  }
> For instance, to perform an HTTP request using the Windows integrated authentication,
the following will correctly authenticate:
> WinHttpClients.createDefault().execute(new HttpGet(...));
> But this will not:
> Executor.newInstance(defaultWinHttpClient).execute(Request.Get(...))
> I think that this behavior is very counter-intuitive and limiting at the same time. When
an Executor is instantiated from an HttpClient instance, all configurations from that instance
should be taken in account.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message