hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sadashiv Patwary" <SPatw...@axeda.com>
Subject RE: Help regarding the detecting NTLM proxy scheme
Date Mon, 21 Apr 2008 18:37:26 GMT
Hi all,
     May be my last mail was not clear. My requirement is if the  scheme is NTLM I have to
show message page.If other scheme's(either authenticated or unauthenticated)  are used load
a applet which will connect to a server and calculate latency. So while loading the applet
I am using httpclient api's to make get request through the proxy .During that time I have
to determine which scheme is being used and decide to load applet or not.
Regards
shiva


-----Original Message-----
From: Sadashiv Patwary [mailto:SPatwary@axeda.com] 
Sent: Monday, April 21, 2008 2:12 PM
To: HttpClient User Discussion
Subject: RE: Help regarding the detecting NTLM proxy scheme

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.Is there there any other
way to get scheme name . 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