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 Nitin Arora <ar...@yahoo.com> on 2011/11/30 01:50:40 UTC

Re: Authenticate Proxy using currently logged on domain user's credentials

Hey guys,

It's been a week now, no replies so far.

Oleg, Do you have any suggestions for the problem that I'm facing or any
pointer on how to achieve integrated user authentication?



Nitin Arora wrote:
> 
> Hi,
> 
> I'm using Apache HttpClient 4.1 version to make http calls to the access
> REST API's exposed on the internet. But internet is accessible through the
> corporate proxy server. Proxy server has NTLM authentication enabled and
> all the applications (IE and Firefox) work fine without prompting the user
> for username and password. IE is able to use current logged in user's
> domain credentials.
> 
> When I run my Java application HttpClient throws 407. How can we enable
> HttpClient to use the currently logged on domain user credentials. I don't
> want the user to enter username and password once they have logged in to
> the computer. 
> 
> Note: I am able to connect the REST API server if I pass the domain
> credentials manually. 
> 
> Thanks in Advance.
> 
> -Nitin
> 

-- 
View this message in context: http://old.nabble.com/Authenticate-Proxy-using-currently-logged-on-domain-user%27s-credentials-tp32873481p32883122.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: Authenticate Proxy using currently logged on domain user's credentials

Posted by albernhagen <an...@gmail.com>.
I'm also interesting in the best way to handle getting the default
credentials.  I want to completely eliminate HttpUrlConnection from my
application and use the Apache HTTP Client only.

Thanks!



--
View this message in context: http://httpcomponents.10934.n7.nabble.com/Authenticate-Proxy-using-currently-logged-on-domain-user-s-credentials-tp11338p20889.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: Authenticate Proxy using currently logged on domain user's credentials

Posted by "yuanyun.cn" <yu...@gmail.com>.
Oleg, Sorry for replying to this old post. But I am facing the same problem
when use http client.

Java URLConnection can use the credential of current logged-on user to
access the protected web resource in remote machine which is in same domain.

But http client can't, I have to add a NTCredential via
httpclient.getCredentialsProvider().setCredentials which is impossible in
product environment as the application has to ask user for this information.

So I am wondering whether there is a way to do this now via httpclient?

Thanks...



--
View this message in context: http://httpcomponents.10934.n7.nabble.com/Authenticate-Proxy-using-currently-logged-on-domain-user-s-credentials-tp11338p19712.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: Authenticate Proxy using currently logged on domain user's credentials

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2011-12-01 at 22:00 +0100, Oleg Kalnichevski wrote:
> On Thu, 2011-12-01 at 10:27 -0800, Nitin Arora wrote:
> > Oleg,
> > 
> > I found out that there is an implementation of HttpURLConnection in the
> > package (sun.net.www.protocol.http) which uses the current logged on user's
> > credentials to perform NTLM authentication. 
> > 
> > Based on the debugging that I've done, I did not see the usage of native
> > windows API. It's a pure Java based implementation.
> 
> I seriously doubt that, but you are very welcome to prove me wrong.
> 

Here you go

http://www.docjar.com/html/api/sun/net/www/protocol/http/NTLMAuthSequence.java.html

Oleg

> > Can't we have the same implementation in the Apache HttpClient library?
> > 
> 
> You are welcome to contribute similar implementation to the project as
> long as it is a 'clean room' implementation which does not contain bits
> of Oracle code.
> 
> Oleg
> 
> > I'm currently figuring out how can I use the same logic as being used in
> > sun.net.www.http.HttpURLConnection in the Apache HttpClient Library. If you
> > aware then can you share your thoughts?
> > 
> > Using native windows API is the last option that I would opt for.
> > 
> > Nitin
> > 
> > 
> > olegk wrote:
> > > 
> > > On Tue, 2011-11-29 at 16:50 -0800, Nitin Arora wrote:
> > >> Hey guys,
> > >> 
> > >> It's been a week now, no replies so far.
> > >> 
> > >> Oleg, Do you have any suggestions for the problem that I'm facing or any
> > >> pointer on how to achieve integrated user authentication?
> > >> 
> > > 
> > > Using Native Windows Security API through JNI.
> > > 
> > > Oleg
> > > 
> > > PS: this issue has been beaten to death on so many occasions that it is
> > > no longer funny.
> > > 
> > > 
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 



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


Re: Authenticate Proxy using currently logged on domain user's credentials

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2011-12-01 at 10:27 -0800, Nitin Arora wrote:
> Oleg,
> 
> I found out that there is an implementation of HttpURLConnection in the
> package (sun.net.www.protocol.http) which uses the current logged on user's
> credentials to perform NTLM authentication. 
> 
> Based on the debugging that I've done, I did not see the usage of native
> windows API. It's a pure Java based implementation.

I seriously doubt that, but you are very welcome to prove me wrong.

> Can't we have the same implementation in the Apache HttpClient library?
> 

You are welcome to contribute similar implementation to the project as
long as it is a 'clean room' implementation which does not contain bits
of Oracle code.

Oleg

> I'm currently figuring out how can I use the same logic as being used in
> sun.net.www.http.HttpURLConnection in the Apache HttpClient Library. If you
> aware then can you share your thoughts?
> 
> Using native windows API is the last option that I would opt for.
> 
> Nitin
> 
> 
> olegk wrote:
> > 
> > On Tue, 2011-11-29 at 16:50 -0800, Nitin Arora wrote:
> >> Hey guys,
> >> 
> >> It's been a week now, no replies so far.
> >> 
> >> Oleg, Do you have any suggestions for the problem that I'm facing or any
> >> pointer on how to achieve integrated user authentication?
> >> 
> > 
> > Using Native Windows Security API through JNI.
> > 
> > Oleg
> > 
> > PS: this issue has been beaten to death on so many occasions that it is
> > no longer funny.
> > 
> > 
> 



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


Re: Authenticate Proxy using currently logged on domain user's credentials

Posted by Nitin Arora <ar...@yahoo.com>.
Oleg,

I found out that there is an implementation of HttpURLConnection in the
package (sun.net.www.protocol.http) which uses the current logged on user's
credentials to perform NTLM authentication. 

Based on the debugging that I've done, I did not see the usage of native
windows API. It's a pure Java based implementation. (Correct me if I'm
wrong)

Can't we have the same implementation in the Apache HttpClient library?

I'm currently figuring out how can I use the same logic as being used in
sun.net.www.http.HttpURLConnection in the Apache HttpClient Library. If you
aware then can you share your thoughts?

Using native windows API is the last option that I would opt for.

Nitin


olegk wrote:
> 
> On Tue, 2011-11-29 at 16:50 -0800, Nitin Arora wrote:
>> Hey guys,
>> 
>> It's been a week now, no replies so far.
>> 
>> Oleg, Do you have any suggestions for the problem that I'm facing or any
>> pointer on how to achieve integrated user authentication?
>> 
> 
> Using Native Windows Security API through JNI.
> 
> Oleg
> 
> PS: this issue has been beaten to death on so many occasions that it is
> no longer funny.
> 
> 

-- 
View this message in context: http://old.nabble.com/Authenticate-Proxy-using-currently-logged-on-domain-user%27s-credentials-tp32873481p32897644.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: Authenticate Proxy using currently logged on domain user's credentials

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2011-11-29 at 16:50 -0800, Nitin Arora wrote:
> Hey guys,
> 
> It's been a week now, no replies so far.
> 
> Oleg, Do you have any suggestions for the problem that I'm facing or any
> pointer on how to achieve integrated user authentication?
> 

Using Native Windows Security API through JNI.

Oleg

PS: this issue has been beaten to death on so many occasions that it is
no longer funny.


> 
> 
> Nitin Arora wrote:
> > 
> > Hi,
> > 
> > I'm using Apache HttpClient 4.1 version to make http calls to the access
> > REST API's exposed on the internet. But internet is accessible through the
> > corporate proxy server. Proxy server has NTLM authentication enabled and
> > all the applications (IE and Firefox) work fine without prompting the user
> > for username and password. IE is able to use current logged in user's
> > domain credentials.
> > 
> > When I run my Java application HttpClient throws 407. How can we enable
> > HttpClient to use the currently logged on domain user credentials. I don't
> > want the user to enter username and password once they have logged in to
> > the computer. 
> > 
> > Note: I am able to connect the REST API server if I pass the domain
> > credentials manually. 
> > 
> > Thanks in Advance.
> > 
> > -Nitin
> > 
> 



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