Hey Nick,

This is what I do for the basic authentication for my application. Hope this
helps.
-------------------------

private static void setAuthentication(DefaultHttpClient httpClient,
HttpRequest methodReq, Credentials credentials, AuthScope authScope) {

 httpClient.getCredentialsProvider().setCredentials(authScope, credentials);

 BasicScheme basicAuth = new BasicScheme();

 try {

 Header authHeader = basicAuth.authenticate(credentials, methodReq);

 methodReq.addHeader(authHeader);

 } catch (AuthenticationException e) {

 e.printStackTrace();

 }

}

---------------


On Wed, Oct 27, 2010 at 8:53 PM, Mills, Nick <[email protected]>wrote:

> I don't want to authenticate with the proxy using NTLM v2 (because it's not
> supported).
> So is there a way to force basic authentication in 4.0.2?
>
> I'm stuck with the 4.0.2 version because I'm using WebDriver 2.0a6.
>
> For older 3.x HttpClients we could do:
>
> HttpClient client = new HttpClient();
> List authPrefs = new ArrayList(2);
> authPrefs.add(AuthPolicy.DIGEST);
> authPrefs.add(AuthPolicy.BASIC);
> // This will exclude the NTLM authentication scheme
> client.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY,
> authPrefs);
>
> Am I able to do something similar with 4.0.2?
>
> Thanks,
> Nick Mills
>



-- 
Regards,
Abhishek Rakshit
[email protected]: (785)214-1324
www.architexa.com

Reply via email to