hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject RE: Help regarding the detecting NTLM proxy scheme
Date Tue, 22 Apr 2008 13:44:19 GMT

On Mon, 2008-04-21 at 14:11 -0400, Sadashiv Patwary wrote:
> Oleg,
>  Below is the piece of code.to get the scheme . I have a question Does scheme name is
always returned irrespective whetherauthentication was success or faild.

This depends on the server

> Is there there any other way to get scheme name . 

No, there is not.

Oleg

> All I want is to display message page to the user if the scheme used  is ntlm.





> Regards
> shiva
> 
> HttpClient httpClient = new HttpClient();
>     if (logger.isDebugEnabled())
>     {
>       logger.debug("httpClient : " + httpClient);
>     }
>      method = new GetMethod(host);
>     method.setDoAuthentication(true);
> executeMethod = httpClient.executeMethod(method);
> AuthState authstate = method.getProxyAuthState();
>     boolean isNTLM = false;
>     try
>     {
>       Map proxyChallenges = AuthChallengeParser.parseChallenges(
>         method.getResponseHeaders(PROXY_AUTH_CHALLENGE));
>       if (proxyChallenges.isEmpty())
>       {
>         logger.debug("Proxy authentication challenge(s) not found");
>         isNTLM = false;
>         return isNTLM;
>       }
>       AuthScheme authscheme = null;
>       /** Authentication processor */
>       AuthChallengeProcessor authProcessor = null;
>       authProcessor = new AuthChallengeProcessor(httpClientParams);
>       authscheme = authProcessor.processChallenge(authstate, proxyChallenges);
>       logger.info("Scheme name is " + authscheme.getSchemeName());
>       if (authscheme.getSchemeName().equalsIgnoreCase("ntlm"))
>       {
>         logger.info("Proxy is using NTLMScheme");
>         isNTLM = true;
>       } else
>       {
>         if (logger.isDebugEnabled())
>         {
>           logger.debug("other proxy is " + authscheme.getSchemeName());
>         }
>         isNTLM = false;
>       }
>     }
> 
> -----Original Message-----
> From: Sadashiv Patwary [mailto:SPatwary@axeda.com] 
> Sent: Tuesday, April 15, 2008 1:51 PM
> To: HttpClient User Discussion
> Subject: RE: Help regarding the detecting NTLM proxy scheme
> 
> Can you please suggest how can I retrieve the proxy scheme ?? . 
> 
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org] 
> Sent: Tuesday, April 15, 2008 1:45 PM
> To: HttpClient User Discussion
> Subject: Re: Help regarding the detecting NTLM proxy scheme
> 
> 
> On Tue, 2008-04-15 at 11:19 -0400, Sadashiv Patwary wrote:
> > Hi all,
> > 
> >       I am still naïve to httpclient. I want to display a  proxy scheme names (NTLM
or digest or basic) on the jsp page. Is it possible do that before I run the httpclient execute
method.
> > 
> 
> No, it is not.
> 
> Oleg
> 
> 
> > Regards
> > 
> > shiva
> > 
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message