You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by jax <ja...@gmail.com> on 2014/07/27 20:31:37 UTC
BasicCredentialsProvider and authentication on Server
Hi All,
I am using basic authentication and posting to a httpcore nio 4.3.2 server.
I am using httpClient 4.3 to create the basic auth as per the example:
CredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(
new AuthScope("localhost", 443),
new UsernamePasswordCredentials("username",
"password"));
However, I don't see any classes/methods to aid in authentication on the
server side and then found this post.
http://httpcomponents.10934.n7.nabble.com/httpcomponents-authentication-digest-parsing-td153.html
So, should i just add the "Authorization" block in my httpPost object as a
header? Or is there a better way to do this?
Thanks, Jax.
--
View this message in context: http://httpcomponents.10934.n7.nabble.com/BasicCredentialsProvider-and-authentication-on-Server-tp23910.html
Sent from the HttpClient-User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: BasicCredentialsProvider and authentication on Server
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Sun, 2014-07-27 at 11:31 -0700, jax wrote:
> Hi All,
> I am using basic authentication and posting to a httpcore nio 4.3.2 server.
> I am using httpClient 4.3 to create the basic auth as per the example:
>
> CredentialsProvider credsProvider = new BasicCredentialsProvider();
> credsProvider.setCredentials(
> new AuthScope("localhost", 443),
> new UsernamePasswordCredentials("username",
> "password"));
>
> However, I don't see any classes/methods to aid in authentication on the
> server side and then found this post.
>
> http://httpcomponents.10934.n7.nabble.com/httpcomponents-authentication-digest-parsing-td153.html
>
> So, should i just add the "Authorization" block in my httpPost object as a
> header? Or is there a better way to do this?
>
> Thanks, Jax.
>
Jax,
For historical reasons [1] HttpCore provides only basic server side
transport components and does not support server side authentication and
state / session management out of the box. This _may_ change in the
future, but for the time being one needs to handle sessions and
authentication manually.
Hope this helps
Oleg
[1] mainly politics
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org