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:[EMAIL PROTECTED]
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:[EMAIL PROTECTED]
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:[EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]