NTLM authentication using JCIFS with HttpClient 3.1

View: New views
9 Messages — Rating Filter:   Alert me  

NTLM authentication using JCIFS with HttpClient 3.1

by arpita dhundia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello people,

I am running into an issue using NTLM authentication with commons HttpClient 3.1. I have tried using JCIFS lib with HttpClient 4.0 for ntlm authentication and its works well.
But now I am trying to use JCIFS with commons HttpClient 3.1 API.. Any idea how can I do that?

Thanks,
Arpita



      Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew

Re: NTLM authentication using JCIFS with HttpClient 3.1

by Valentin Popov-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

private HttpClient newClient(String uri, int hostConnectionNumber)  
throws HttpException, IOException{
                       
            Protocol.registerProtocol("https", new Protocol("https",  
(ProtocolSocketFactory) new EasySSLProtocolSocketFactory(), 443));
                       
                       
                        HostConfiguration hostConfig = new HostConfiguration();
                    hostConfig.setHost(uri);
               
                    HttpConnectionManager connectionManager = new  
MultiThreadedHttpConnectionManager();
                    HttpConnectionManagerParams params = new  
HttpConnectionManagerParams();
                    int maxHostConnections = hostConnectionNumber;
                    params.setMaxConnectionsPerHost(hostConfig, maxHostConnections);
                    connectionManager.setParams(params);
               
                    HttpClient client = new HttpClient(connectionManager);
                    client.getHostConfiguration().setHost("smallbusiness.local", 80,  
"http");
                    client.getParams().setCookiePolicy
(CookiePolicy.BROWSER_COMPATIBILITY);
                    client.setHostConfiguration(hostConfig);
                    Credentials creds = new NTCredentials
(ExchangeStubbingWD.adminName, ExchangeStubbingWD.adminPassword,  
ExchangeStubbingWD.serverIP, ExchangeStubbingWD.domainName);
                    client.getState().setCredentials(AuthScope.ANY, creds);
               
                    return client;
                       
                }

Regards
Valentin





30.10.2009, в 16:47, arpita dhundia написал(а):

>
> Hello people,
>
> I am running into an issue using NTLM authentication with commons  
> HttpClient 3.1. I have tried using JCIFS lib with HttpClient 4.0 for  
> ntlm authentication and its works well.
> But now I am trying to use JCIFS with commons HttpClient 3.1 API..  
> Any idea how can I do that?
>
> Thanks,
> Arpita
>
>
>
>      Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew


Re: NTLM authentication using JCIFS with HttpClient 3.1

by arpita dhundia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for your reply Valentin.

I have already tried this basic implementation and it returns "Failure authenticating with NTLM <any realm>@62.92.72.125:80" to me.
I dont understand why does it have any realm in it, while I am explicitly passing the domain to auntheticate in (for NTLM the authentication domain is treated as Realm, right?)

I tried using jcifs with httpclient 4.0 and it works, but I need to use the commons API for some other purpose hence now I am trying to use JCIFS with commons HTTPClient API.


Regards,
Arpita



Happiness is the result of being

too busy to be unhappy....!!!

Best Wishes

Arpita

--- On Fri, 30/10/09, Valentin Popov <valentin.po@...> wrote:

From: Valentin Popov <valentin.po@...>
Subject: Re: NTLM authentication using JCIFS with HttpClient 3.1
To: "HttpClient User Discussion" <httpclient-users@...>
Date: Friday, 30 October, 2009, 7:19 PM

private HttpClient newClient(String uri, int hostConnectionNumber) throws HttpException, IOException{
           
            Protocol.registerProtocol("https", new Protocol("https", (ProtocolSocketFactory) new EasySSLProtocolSocketFactory(), 443));
           
           
            HostConfiguration hostConfig = new HostConfiguration();
            hostConfig.setHost(uri);
       
            HttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
            HttpConnectionManagerParams params = new HttpConnectionManagerParams();
            int maxHostConnections = hostConnectionNumber;
            params.setMaxConnectionsPerHost(hostConfig, maxHostConnections);
            connectionManager.setParams(params);
       
            HttpClient client = new HttpClient(connectionManager);
            client.getHostConfiguration().setHost("smallbusiness.local", 80, "http");
            client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
            client.setHostConfiguration(hostConfig);
            Credentials creds = new NTCredentials(ExchangeStubbingWD.adminName, ExchangeStubbingWD.adminPassword, ExchangeStubbingWD.serverIP, ExchangeStubbingWD.domainName);
            client.getState().setCredentials(AuthScope.ANY, creds);
       
            return client;
           
        }

Regards
Valentin





30.10.2009, в 16:47, arpita dhundia написал(а):

>
> Hello people,
>
> I am running into an issue using NTLM authentication with commons HttpClient 3.1. I have tried using JCIFS lib with HttpClient 4.0 for ntlm authentication and its works well.
> But now I am trying to use JCIFS with commons HttpClient 3.1 API.. Any idea how can I do that?
>
> Thanks,
> Arpita
>
>
>
>      Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew




      Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew

Re: NTLM authentication using JCIFS with HttpClient 3.1

by Valentin Popov-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I use it like

Credentials creds = new NTCredentials("Administrator", "test",  
"192.168.1.2", "smallbusiness.local");



Regards
Valentin




30.10.2009, в 18:12, arpita dhundia написал(а):

> Thanks for your reply Valentin.
>
> I have already tried this basic implementation and it returns  
> "Failure authenticating with NTLM <any realm>@62.92.72.125:80" to me.
> I dont understand why does it have any realm in it, while I am  
> explicitly passing the domain to auntheticate in (for NTLM the  
> authentication domain is treated as Realm, right?)
>
> I tried using jcifs with httpclient 4.0 and it works, but I need to  
> use the commons API for some other purpose hence now I am trying to  
> use JCIFS with commons HTTPClient API.
>
>
> Regards,
> Arpita
>
>
>
> Happiness is the result of being
>
> too busy to be unhappy....!!!
>
> Best Wishes
>
> Arpita
>
> --- On Fri, 30/10/09, Valentin Popov <valentin.po@...> wrote:
>
> From: Valentin Popov <valentin.po@...>
> Subject: Re: NTLM authentication using JCIFS with HttpClient 3.1
> To: "HttpClient User Discussion" <httpclient-users@...>
> Date: Friday, 30 October, 2009, 7:19 PM
>
> private HttpClient newClient(String uri, int hostConnectionNumber)  
> throws HttpException, IOException{
>
>             Protocol.registerProtocol("https", new Protocol("https",  
> (ProtocolSocketFactory) new EasySSLProtocolSocketFactory(), 443));
>
>
>             HostConfiguration hostConfig = new HostConfiguration();
>             hostConfig.setHost(uri);
>
>             HttpConnectionManager connectionManager = new  
> MultiThreadedHttpConnectionManager();
>             HttpConnectionManagerParams params = new  
> HttpConnectionManagerParams();
>             int maxHostConnections = hostConnectionNumber;
>             params.setMaxConnectionsPerHost(hostConfig,  
> maxHostConnections);
>             connectionManager.setParams(params);
>
>             HttpClient client = new HttpClient(connectionManager);
>             client.getHostConfiguration().setHost
> ("smallbusiness.local", 80, "http");
>             client.getParams().setCookiePolicy
> (CookiePolicy.BROWSER_COMPATIBILITY);
>             client.setHostConfiguration(hostConfig);
>             Credentials creds = new NTCredentials
> (ExchangeStubbingWD.adminName, ExchangeStubbingWD.adminPassword,  
> ExchangeStubbingWD.serverIP, ExchangeStubbingWD.domainName);
>             client.getState().setCredentials(AuthScope.ANY, creds);
>
>             return client;
>
>         }
>
> Regards
> Valentin
>
>
>
>
>
> 30.10.2009, в 16:47, arpita dhundia написал(а):
>
>>
>> Hello people,
>>
>> I am running into an issue using NTLM authentication with commons  
>> HttpClient 3.1. I have tried using JCIFS lib with HttpClient 4.0  
>> for ntlm authentication and its works well.
>> But now I am trying to use JCIFS with commons HttpClient 3.1 API..  
>> Any idea how can I do that?
>>
>> Thanks,
>> Arpita
>>
>>
>>
>>       Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew
>
>
>
>
>      Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew


Re: NTLM authentication using JCIFS with HttpClient 3.1

by arpita dhundia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok. Is "smallbusiness.local" the domain under which the user is being authenticated?

Regards,
Arpita

--- On Fri, 30/10/09, Valentin Popov <valentin.po@...> wrote:

From: Valentin Popov <valentin.po@...>
Subject: Re: NTLM authentication using JCIFS with HttpClient 3.1
To: "HttpClient User Discussion" <httpclient-users@...>
Date: Friday, 30 October, 2009, 8:47 PM

I use it like

Credentials creds = new NTCredentials("Administrator", "test", "192.168.1.2", "smallbusiness.local");



Regards
Valentin




30.10.2009, в 18:12, arpita dhundia написал(а):

> Thanks for your reply Valentin.
>
> I have already tried this basic implementation and it returns "Failure authenticating with NTLM <any realm>@62.92.72.125:80" to me.
> I dont understand why does it have any realm in it, while I am explicitly passing the domain to auntheticate in (for NTLM the authentication domain is treated as Realm, right?)
>
> I tried using jcifs with httpclient 4.0 and it works, but I need to use the commons API for some other purpose hence now I am trying to use JCIFS with commons HTTPClient API.
>
>
> Regards,
> Arpita
>
>
>
> Happiness is the result of being
>
> too busy to be unhappy....!!!
>
> Best Wishes
>
> Arpita
>
> --- On Fri, 30/10/09, Valentin Popov <valentin.po@...> wrote:
>
> From: Valentin Popov <valentin.po@...>
> Subject: Re: NTLM authentication using JCIFS with HttpClient 3.1
> To: "HttpClient User Discussion" <httpclient-users@...>
> Date: Friday, 30 October, 2009, 7:19 PM
>
> private HttpClient newClient(String uri, int hostConnectionNumber) throws HttpException, IOException{
>
>             Protocol.registerProtocol("https", new Protocol("https", (ProtocolSocketFactory) new EasySSLProtocolSocketFactory(), 443));
>
>
>             HostConfiguration hostConfig = new HostConfiguration();
>             hostConfig.setHost(uri);
>
>             HttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
>             HttpConnectionManagerParams params = new HttpConnectionManagerParams();
>             int maxHostConnections = hostConnectionNumber;
>             params.setMaxConnectionsPerHost(hostConfig, maxHostConnections);
>             connectionManager.setParams(params);
>
>             HttpClient client = new HttpClient(connectionManager);
>             client.getHostConfiguration().setHost("smallbusiness.local", 80, "http");
>             client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
>             client.setHostConfiguration(hostConfig);
>             Credentials creds = new NTCredentials(ExchangeStubbingWD.adminName, ExchangeStubbingWD.adminPassword, ExchangeStubbingWD.serverIP, ExchangeStubbingWD.domainName);
>             client.getState().setCredentials(AuthScope.ANY, creds);
>
>             return client;
>
>         }
>
> Regards
> Valentin
>
>
>
>
>
> 30.10.2009, в 16:47, arpita dhundia написал(а):
>
>>
>> Hello people,
>>
>> I am running into an issue using NTLM authentication with commons HttpClient 3.1. I have tried using JCIFS lib with HttpClient 4.0 for ntlm authentication and its works well.
>> But now I am trying to use JCIFS with commons HttpClient 3.1 API.. Any idea how can I do that?
>>
>> Thanks,
>> Arpita
>>
>>
>>
>>       Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew
>
>
>
>
>      Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew




      Now, send attachments up to 25MB with Yahoo! India Mail. Learn how. http://in.overview.mail.yahoo.com/photos

Re: NTLM authentication using JCIFS with HttpClient 3.1

by Valentin Popov-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes

  С Уважением,
Валентин Попов





30.10.2009, в 18:39, arpita dhundia написал(а):

> Ok. Is "smallbusiness.local" the domain under which the user is  
> being authenticated?
>
> Regards,
> Arpita
>
> --- On Fri, 30/10/09, Valentin Popov <valentin.po@...> wrote:
>
> From: Valentin Popov <valentin.po@...>
> Subject: Re: NTLM authentication using JCIFS with HttpClient 3.1
> To: "HttpClient User Discussion" <httpclient-users@...>
> Date: Friday, 30 October, 2009, 8:47 PM
>
> I use it like
>
> Credentials creds = new NTCredentials("Administrator", "test",  
> "192.168.1.2", "smallbusiness.local");
>
>
>
> Regards
> Valentin
>
>
>
>
> 30.10.2009, в 18:12, arpita dhundia написал(а):
>
>> Thanks for your reply Valentin.
>>
>> I have already tried this basic implementation and it returns  
>> "Failure authenticating with NTLM <any realm>@62.92.72.125:80" to me.
>> I dont understand why does it have any realm in it, while I am  
>> explicitly passing the domain to auntheticate in (for NTLM the  
>> authentication domain is treated as Realm, right?)
>>
>> I tried using jcifs with httpclient 4.0 and it works, but I need to  
>> use the commons API for some other purpose hence now I am trying to  
>> use JCIFS with commons HTTPClient API.
>>
>>
>> Regards,
>> Arpita
>>
>>
>>
>> Happiness is the result of being
>>
>> too busy to be unhappy....!!!
>>
>> Best Wishes
>>
>> Arpita
>>
>> --- On Fri, 30/10/09, Valentin Popov <valentin.po@...> wrote:
>>
>> From: Valentin Popov <valentin.po@...>
>> Subject: Re: NTLM authentication using JCIFS with HttpClient 3.1
>> To: "HttpClient User Discussion" <httpclient-users@...>
>> Date: Friday, 30 October, 2009, 7:19 PM
>>
>> private HttpClient newClient(String uri, int hostConnectionNumber)  
>> throws HttpException, IOException{
>>
>>              Protocol.registerProtocol("https", new Protocol
>> ("https", (ProtocolSocketFactory) new EasySSLProtocolSocketFactory
>> (), 443));
>>
>>
>>              HostConfiguration hostConfig = new HostConfiguration();
>>              hostConfig.setHost(uri);
>>
>>              HttpConnectionManager connectionManager = new  
>> MultiThreadedHttpConnectionManager();
>>              HttpConnectionManagerParams params = new  
>> HttpConnectionManagerParams();
>>              int maxHostConnections = hostConnectionNumber;
>>              params.setMaxConnectionsPerHost(hostConfig,  
>> maxHostConnections);
>>              connectionManager.setParams(params);
>>
>>              HttpClient client = new HttpClient(connectionManager);
>>              client.getHostConfiguration().setHost
>> ("smallbusiness.local", 80, "http");
>>              client.getParams().setCookiePolicy
>> (CookiePolicy.BROWSER_COMPATIBILITY);
>>              client.setHostConfiguration(hostConfig);
>>              Credentials creds = new NTCredentials
>> (ExchangeStubbingWD.adminName, ExchangeStubbingWD.adminPassword,  
>> ExchangeStubbingWD.serverIP, ExchangeStubbingWD.domainName);
>>              client.getState().setCredentials(AuthScope.ANY, creds);
>>
>>              return client;
>>
>>          }
>>
>> Regards
>> Valentin
>>
>>
>>
>>
>>
>> 30.10.2009, в 16:47, arpita dhundia написал(а):
>>
>>>
>>> Hello people,
>>>
>>> I am running into an issue using NTLM authentication with commons  
>>> HttpClient 3.1. I have tried using JCIFS lib with HttpClient 4.0  
>>> for ntlm authentication and its works well.
>>> But now I am trying to use JCIFS with commons HttpClient 3.1 API..  
>>> Any idea how can I do that?
>>>
>>> Thanks,
>>> Arpita
>>>
>>>
>>>
>>>        Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew
>>
>>
>>
>>
>>       Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew
>
>
>
>
>      Now, send attachments up to 25MB with Yahoo! India Mail. Learn  
> how. http://in.overview.mail.yahoo.com/photos


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


Re: NTLM authentication using JCIFS with HttpClient 3.1

by arpita dhundia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I tried .local as well, still no luck
Returns the same <any realm> error.

Still thanks for your response.

Regards,
Arpita

--- On Fri, 30/10/09, Valentin Popov <valentin.po@...> wrote:

From: Valentin Popov <valentin.po@...>
Subject: Re: NTLM authentication using JCIFS with HttpClient 3.1
To: "HttpClient User Discussion" <httpclient-users@...>
Date: Friday, 30 October, 2009, 9:13 PM

Yes

 С Уважением,
Валентин Попов





30.10.2009, в 18:39, arpita dhundia написал(а):

> Ok. Is "smallbusiness.local" the domain under which the user is being authenticated?
>
> Regards,
> Arpita
>
> --- On Fri, 30/10/09, Valentin Popov <valentin.po@...> wrote:
>
> From: Valentin Popov <valentin.po@...>
> Subject: Re: NTLM authentication using JCIFS with HttpClient 3.1
> To: "HttpClient User Discussion" <httpclient-users@...>
> Date: Friday, 30 October, 2009, 8:47 PM
>
> I use it like
>
> Credentials creds = new NTCredentials("Administrator", "test", "192.168.1.2", "smallbusiness.local");
>
>
>
> Regards
> Valentin
>
>
>
>
> 30.10.2009, в 18:12, arpita dhundia написал(а):
>
>> Thanks for your reply Valentin.
>>
>> I have already tried this basic implementation and it returns "Failure authenticating with NTLM <any realm>@62.92.72.125:80" to me.
>> I dont understand why does it have any realm in it, while I am explicitly passing the domain to auntheticate in (for NTLM the authentication domain is treated as Realm, right?)
>>
>> I tried using jcifs with httpclient 4.0 and it works, but I need to use the commons API for some other purpose hence now I am trying to use JCIFS with commons HTTPClient API.
>>
>>
>> Regards,
>> Arpita
>>
>>
>>
>> Happiness is the result of being
>>
>> too busy to be unhappy....!!!
>>
>> Best Wishes
>>
>> Arpita
>>
>> --- On Fri, 30/10/09, Valentin Popov <valentin.po@...> wrote:
>>
>> From: Valentin Popov <valentin.po@...>
>> Subject: Re: NTLM authentication using JCIFS with HttpClient 3.1
>> To: "HttpClient User Discussion" <httpclient-users@...>
>> Date: Friday, 30 October, 2009, 7:19 PM
>>
>> private HttpClient newClient(String uri, int hostConnectionNumber) throws HttpException, IOException{
>>
>>              Protocol.registerProtocol("https", new Protocol("https", (ProtocolSocketFactory) new EasySSLProtocolSocketFactory(), 443));
>>
>>
>>              HostConfiguration hostConfig = new HostConfiguration();
>>              hostConfig.setHost(uri);
>>
>>              HttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
>>              HttpConnectionManagerParams params = new HttpConnectionManagerParams();
>>              int maxHostConnections = hostConnectionNumber;
>>              params.setMaxConnectionsPerHost(hostConfig, maxHostConnections);
>>              connectionManager.setParams(params);
>>
>>              HttpClient client = new HttpClient(connectionManager);
>>              client.getHostConfiguration().setHost("smallbusiness.local", 80, "http");
>>              client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
>>              client.setHostConfiguration(hostConfig);
>>              Credentials creds = new NTCredentials(ExchangeStubbingWD.adminName, ExchangeStubbingWD.adminPassword, ExchangeStubbingWD.serverIP, ExchangeStubbingWD.domainName);
>>              client.getState().setCredentials(AuthScope.ANY, creds);
>>
>>              return client;
>>
>>          }
>>
>> Regards
>> Valentin
>>
>>
>>
>>
>>
>> 30.10.2009, в 16:47, arpita dhundia написал(а):
>>
>>>
>>> Hello people,
>>>
>>> I am running into an issue using NTLM authentication with commons HttpClient 3.1. I have tried using JCIFS lib with HttpClient 4.0 for ntlm authentication and its works well.
>>> But now I am trying to use JCIFS with commons HttpClient 3.1 API.. Any idea how can I do that?
>>>
>>> Thanks,
>>> Arpita
>>>
>>>
>>>
>>>        Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew
>>
>>
>>
>>
>>       Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew
>
>
>
>
>      Now, send attachments up to 25MB with Yahoo! India Mail. Learn how. http://in.overview.mail.yahoo.com/photos


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




      Yahoo! India has a new look. Take a sneak peek http://in.yahoo.com/trynew

Re: NTLM authentication using JCIFS with HttpClient 3.1

by Valentin Popov-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No problem.
Try use WireShark to debug good session, and bad session - you will  
see difference it will be answer.

Regards
Valentin



30.10.2009, в 18:45, arpita dhundia написал(а):

> I tried .local as well, still no luck
> Returns the same <any realm> error.
>
> Still thanks for your response.
>
> Regards,
> Arpita
>
> --- On Fri, 30/10/09, Valentin Popov <valentin.po@...> wrote:
>
> From: Valentin Popov <valentin.po@...>
> Subject: Re: NTLM authentication using JCIFS with HttpClient 3.1
> To: "HttpClient User Discussion" <httpclient-users@...>
> Date: Friday, 30 October, 2009, 9:13 PM
>
> Yes
>
> С Уважением,
> Валентин Попов
>
>
>
>
>
> 30.10.2009, в 18:39, arpita dhundia написал(а):
>
>> Ok. Is "smallbusiness.local" the domain under which the user is  
>> being authenticated?
>>
>> Regards,
>> Arpita
>>
>> --- On Fri, 30/10/09, Valentin Popov <valentin.po@...> wrote:
>>
>> From: Valentin Popov <valentin.po@...>
>> Subject: Re: NTLM authentication using JCIFS with HttpClient 3.1
>> To: "HttpClient User Discussion" <httpclient-users@...>
>> Date: Friday, 30 October, 2009, 8:47 PM
>>
>> I use it like
>>
>> Credentials creds = new NTCredentials("Administrator", "test",  
>> "192.168.1.2", "smallbusiness.local");
>>
>>
>>
>> Regards
>> Valentin
>>
>>
>>
>>
>> 30.10.2009, в 18:12, arpita dhundia написал(а):
>>
>>> Thanks for your reply Valentin.
>>>
>>> I have already tried this basic implementation and it returns  
>>> "Failure authenticating with NTLM <any realm>@62.92.72.125:80" to  
>>> me.
>>> I dont understand why does it have any realm in it, while I am  
>>> explicitly passing the domain to auntheticate in (for NTLM the  
>>> authentication domain is treated as Realm, right?)
>>>
>>> I tried using jcifs with httpclient 4.0 and it works, but I need  
>>> to use the commons API for some other purpose hence now I am  
>>> trying to use JCIFS with commons HTTPClient API.
>>>
>>>
>>> Regards,
>>> Arpita
>>>
>>>
>>>
>>> Happiness is the result of being
>>>
>>> too busy to be unhappy....!!!
>>>
>>> Best Wishes
>>>
>>> Arpita
>>>
>>> --- On Fri, 30/10/09, Valentin Popov <valentin.po@...> wrote:
>>>
>>> From: Valentin Popov <valentin.po@...>
>>> Subject: Re: NTLM authentication using JCIFS with HttpClient 3.1
>>> To: "HttpClient User Discussion" <httpclient-users@...>
>>> Date: Friday, 30 October, 2009, 7:19 PM
>>>
>>> private HttpClient newClient(String uri, int hostConnectionNumber)  
>>> throws HttpException, IOException{
>>>
>>>               Protocol.registerProtocol("https", new Protocol
>>> ("https", (ProtocolSocketFactory) new EasySSLProtocolSocketFactory
>>> (), 443));
>>>
>>>
>>>               HostConfiguration hostConfig = new HostConfiguration
>>> ();
>>>               hostConfig.setHost(uri);
>>>
>>>               HttpConnectionManager connectionManager = new  
>>> MultiThreadedHttpConnectionManager();
>>>               HttpConnectionManagerParams params = new  
>>> HttpConnectionManagerParams();
>>>               int maxHostConnections = hostConnectionNumber;
>>>               params.setMaxConnectionsPerHost(hostConfig,  
>>> maxHostConnections);
>>>               connectionManager.setParams(params);
>>>
>>>               HttpClient client = new HttpClient(connectionManager);
>>>               client.getHostConfiguration().setHost
>>> ("smallbusiness.local", 80, "http");
>>>               client.getParams().setCookiePolicy
>>> (CookiePolicy.BROWSER_COMPATIBILITY);
>>>               client.setHostConfiguration(hostConfig);
>>>               Credentials creds = new NTCredentials
>>> (ExchangeStubbingWD.adminName, ExchangeStubbingWD.adminPassword,  
>>> ExchangeStubbingWD.serverIP, ExchangeStubbingWD.domainName);
>>>               client.getState().setCredentials(AuthScope.ANY,  
>>> creds);
>>>
>>>               return client;
>>>
>>>           }
>>>
>>> Regards
>>> Valentin
>>>
>>>
>>>
>>>
>>>
>>> 30.10.2009, в 16:47, arpita dhundia написал(а):
>>>
>>>>
>>>> Hello people,
>>>>
>>>> I am running into an issue using NTLM authentication with commons  
>>>> HttpClient 3.1. I have tried using JCIFS lib with HttpClient 4.0  
>>>> for ntlm authentication and its works well.
>>>> But now I am trying to use JCIFS with commons HttpClient 3.1  
>>>> API.. Any idea how can I do that?
>>>>
>>>> Thanks,
>>>> Arpita
>>>>
>>>>
>>>>
>>>>         Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew
>>>
>>>
>>>
>>>
>>>        Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew
>>
>>
>>
>>
>>       Now, send attachments up to 25MB with Yahoo! India Mail.  
>> Learn how. http://in.overview.mail.yahoo.com/photos
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@...
> For additional commands, e-mail: httpclient-users-help@...
>
>
>
>
>      Yahoo! India has a new look. Take a sneak peek http://in.yahoo.com/trynew


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


Re: NTLM authentication using JCIFS with HttpClient 3.1

by olegk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

arpita dhundia wrote:
> Hello people,
>
> I am running into an issue using NTLM authentication with commons HttpClient 3.1. I have tried using JCIFS lib with HttpClient 4.0 for ntlm authentication and its works well.
> But now I am trying to use JCIFS with commons HttpClient 3.1 API.. Any idea how can I do that?
>

You need to implement the following interface [1] and register your
custom implementation with HttpClient instead of the default one [2].

Oleg

[1]
http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/auth/AuthScheme.html
[2]
http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/auth/AuthPolicy.html


> Thanks,
> Arpita
>
>
>
>       Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew


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