Re: Almost there just need a little more help...
Ok I found his example that might almost do what I need but I want the user id and password coming from a popup dialog like the one I have seen coming from Metro (JAX-WS). client.getParams().setAuthenticationPreemptive(true); client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(user.getUsername(), user.getPassword())); I will keep looking. -Tony --- On Mon, 12/31/12, Tony Anecito wrote: From: Tony Anecito Subject: Re: Almost there just need a little more help... To: "HttpClient User Discussion" Date: Monday, December 31, 2012, 8:58 PM I did find an example called ClientAuthentication but it looks like it assumes you always have to authenticate but I only want to do that if needed. So if in a coffee shop where NTLM is not needed for example I do not want to do that but if in a location where NTLM is needed I do want to do the call httpclient.getCredentialsProvider().setCredentials(). Thanks for the advice. -Tony --- On Mon, 12/31/12, Tony Anecito wrote: From: Tony Anecito Subject: Almost there just need a little more help... To: httpclient-users@hc.apache.org Date: Monday, December 31, 2012, 8:47 PM Hi All, I am currently using JAX-WS and have been working on using JAX-RS using Jersey and Apache Http Client. I have gotten requests to work between between my client and jax-rs service. When I tried in an environment where NTLM is used I could not get my http requests to go through the network. Now I remember having to work through this with JAX-WS but I am not sure what to get http client to work using NTLM. What I want to have happen is the first time I try to connect using apache http client I want a dialog to show asking for login/password and after that is done be able to create requests that go all the way through to my remote server running my web services. So how can I do that? Is there an example somewhere on how to make it work that way without a lot of coding? Thanks for the help. -Tony
Re: Almost there just need a little more help...
I did find an example called ClientAuthentication but it looks like it assumes you always have to authenticate but I only want to do that if needed. So if in a coffee shop where NTLM is not needed for example I do not want to do that but if in a location where NTLM is needed I do want to do the call httpclient.getCredentialsProvider().setCredentials(). Thanks for the advice. -Tony --- On Mon, 12/31/12, Tony Anecito wrote: From: Tony Anecito Subject: Almost there just need a little more help... To: httpclient-users@hc.apache.org Date: Monday, December 31, 2012, 8:47 PM Hi All, I am currently using JAX-WS and have been working on using JAX-RS using Jersey and Apache Http Client. I have gotten requests to work between between my client and jax-rs service. When I tried in an environment where NTLM is used I could not get my http requests to go through the network. Now I remember having to work through this with JAX-WS but I am not sure what to get http client to work using NTLM. What I want to have happen is the first time I try to connect using apache http client I want a dialog to show asking for login/password and after that is done be able to create requests that go all the way through to my remote server running my web services. So how can I do that? Is there an example somewhere on how to make it work that way without a lot of coding? Thanks for the help. -Tony
Almost there just need a little more help...
Hi All, I am currently using JAX-WS and have been working on using JAX-RS using Jersey and Apache Http Client. I have gotten requests to work between between my client and jax-rs service. When I tried in an environment where NTLM is used I could not get my http requests to go through the network. Now I remember having to work through this with JAX-WS but I am not sure what to get http client to work using NTLM. What I want to have happen is the first time I try to connect using apache http client I want a dialog to show asking for login/password and after that is done be able to create requests that go all the way through to my remote server running my web services. So how can I do that? Is there an example somewhere on how to make it work that way without a lot of coding? Thanks for the help. -Tony