[Webtest] NTLM authentication and htmlunit 1.9

Michael Dunn webtest@lists.canoo.com
Wed, 12 Jul 2006 15:41:15 -0700


This is a multi-part message in MIME format.

------_=_NextPart_001_01C6A604.48C69F61
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

nevermind...i figured it out. my use of "" to mean null for the host
parameter causes it to fail.=20
the following now works:
=20
prov.addNTLMCredentials("username","password",null,-1,"mymachinename","m
ydomain");

in fact the following also works fine:
=20
prov.addNTLMCredentials("username","password",null,-1,"","");

thanks go to marc for his modification to HTMLUnit 1.9 to add this
functionality. now we can continue to use webtest for testing our
application.
=20
later,
mikey
=20

Michael Dunn=20
Product Test Manager=20
Adaptis=20
206 342 7478=20

=20

________________________________

From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com] On Behalf Of Michael Dunn
Sent: Wednesday, July 12, 2006 9:35 AM
To: webtest@lists.canoo.com
Subject: RE: [Webtest] NTLM authentication and htmlunit 1.9


                <groovy>
                    def prov =3D new
com.gargoylesoftware.htmlunit.DefaultCredentialsProvider();
=20
prov.addNTLMCredentials("username","password","",-1,"mymachinename","myd
omain");
                    def webClient =3D step.context.webClient;
                    webClient.setCredentialsProvider(prov);
                </groovy>
                <invoke  ...
=20
even though i have debug turned on in webtest, i get no messages while
groovy is processing the script.
=20
later,
mikey

Michael Dunn=20
Product Test Manager=20
Adaptis=20
206 342 7478=20

=20

________________________________

From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com] On Behalf Of Dierk Koenig
Sent: Tuesday, July 11, 2006 11:30 PM
To: webtest@lists.canoo.com
Subject: RE: [Webtest] NTLM authentication and htmlunit 1.9


Hi Michael,
=20
how does your Groovy step look like?
=20
cheers
Mittie

	-----Original Message-----
	From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com]On Behalf Of Michael Dunn
	Sent: Mittwoch, 12. Juli 2006 0:28
	To: webtest@lists.canoo.com
	Subject: [Webtest] NTLM authentication and htmlunit 1.9
=09
=09
	i see that the new version of webtest (R_1354) includes a new
version of htmlunit (1.9) where marc did some work on extending
DefaultCredentialsProvider to include setting NTLM credentials. does
anyone know how one would utilize this in webtest to login to a NTLM
authenticated webpage?
	=20
	i have installed R_1354 and have tried setting the credentials
in a groovy step as well as just passing in the username and password in
the invoke statement. neither of which worked for me. any ideas?
	=20
	later,
	mikey
	=20

	Michael Dunn=20
	Product Test Manager=20
	Adaptis=20
	206 342 7478=20

	=20


------_=_NextPart_001_01C6A604.48C69F61
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2900.2912" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D426433222-12072006><FONT face=3DArial color=3D#0000ff =

size=3D2>nevermind...i figured it out. my use of "" to mean null for the =
host=20
parameter causes it to fail. </FONT></SPAN></DIV>
<DIV><SPAN class=3D426433222-12072006><FONT face=3DArial color=3D#0000ff =
size=3D2>the=20
following now works:</FONT></SPAN></DIV>
<DIV><SPAN class=3D426433222-12072006><FONT face=3DArial color=3D#0000ff =

size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
prov.addNTLMCredentials("username","password",null,-1,"mymachinename","my=
domain");<BR></FONT></SPAN></DIV>
<DIV><SPAN class=3D426433222-12072006><FONT face=3DArial color=3D#0000ff =
size=3D2>in=20
fact the following also works fine:</DIV></FONT></SPAN>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D426433222-12072006><FONT=20
face=3DArial color=3D#0000ff=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
prov.addNTLMCredentials("username","password",null,-1,"","");<BR></FONT><=
/SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D426433222-12072006><FONT=20
face=3DArial color=3D#0000ff size=3D2>thanks go to marc for his =
modification to=20
HTMLUnit 1.9 to add this functionality. now we can continue to use =
webtest for=20
testing our application.</FONT></SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D426433222-12072006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D426433222-12072006>later,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D426433222-12072006>mikey</SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><SPAN =
class=3D426433222-12072006><FONT=20
face=3DArial color=3D#0000ff size=3D2>&nbsp;</DIV></FONT></SPAN></FONT>
<P align=3Dleft><FONT size=3D2><FONT face=3DArial><FONT =
color=3D#008080>Michael=20
Dunn</FONT> <BR></FONT></FONT><FONT size=3D2><FONT face=3DArial><FONT=20
color=3D#008080>Product Test Manager</FONT> <BR><FONT =
color=3D#008080>Adaptis</FONT>=20
<BR><FONT color=3D#008080>206 342 7478</FONT></FONT></FONT> </P>
<DIV>&nbsp;</DIV><BR>
<DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
<HR tabIndex=3D-1>
<FONT face=3DTahoma size=3D2><B>From:</B> webtest-admin@lists.canoo.com=20
[mailto:webtest-admin@lists.canoo.com] <B>On Behalf Of </B>Michael=20
Dunn<BR><B>Sent:</B> Wednesday, July 12, 2006 9:35 AM<BR><B>To:</B>=20
webtest@lists.canoo.com<BR><B>Subject:</B> RE: [Webtest] NTLM =
authentication and=20
htmlunit 1.9<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;groovy&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
def prov =3D new=20
com.gargoylesoftware.htmlunit.DefaultCredentialsProvider();<BR>&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
prov.addNTLMCredentials("username","password","",-1,"mymachinename","mydo=
main");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
def webClient =3D step.context.webClient<SPAN=20
class=3D213262716-12072006>;</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
webClient.setCredentialsProvider(prov);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;/groovy&gt;<BR><SPAN=20
class=3D213262716-12072006>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;invoke</SPAN></FONT></FONT></FONT><FONT face=3DArial><FONT =
color=3D#0000ff><FONT=20
size=3D2><SPAN class=3D213262716-12072006>&nbsp;=20
...</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2></FONT>&nbsp;</DIV>
<DIV><SPAN class=3D213262716-12072006><FONT face=3DArial color=3D#0000ff =
size=3D2>even=20
though i have debug turned on in webtest, i get no messages while groovy =
is=20
processing the script.</FONT></SPAN></DIV>
<DIV><SPAN class=3D213262716-12072006><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D213262716-12072006><FONT face=3DArial color=3D#0000ff =

size=3D2>later,</FONT></SPAN></DIV>
<DIV><SPAN class=3D213262716-12072006><FONT face=3DArial color=3D#0000ff =

size=3D2>mikey</FONT></SPAN></DIV>
<P align=3Dleft><FONT size=3D2><FONT face=3DArial><FONT =
color=3D#008080>Michael=20
Dunn</FONT> <BR></FONT></FONT><FONT size=3D2><FONT face=3DArial><FONT=20
color=3D#008080>Product Test Manager</FONT> <BR><FONT =
color=3D#008080>Adaptis</FONT>=20
<BR><FONT color=3D#008080>206 342 7478</FONT></FONT></FONT> </P>
<DIV>&nbsp;</DIV><BR>
<DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
<HR tabIndex=3D-1>
<FONT face=3DTahoma size=3D2><B>From:</B> webtest-admin@lists.canoo.com=20
[mailto:webtest-admin@lists.canoo.com] <B>On Behalf Of </B>Dierk=20
Koenig<BR><B>Sent:</B> Tuesday, July 11, 2006 11:30 PM<BR><B>To:</B>=20
webtest@lists.canoo.com<BR><B>Subject:</B> RE: [Webtest] NTLM =
authentication and=20
htmlunit 1.9<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><SPAN class=3D939491806-12072006><FONT face=3DArial color=3D#0000ff =
size=3D2>Hi=20
Michael,</FONT></SPAN></DIV>
<DIV><SPAN class=3D939491806-12072006><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D939491806-12072006><FONT face=3DArial color=3D#0000ff =
size=3D2>how=20
does your Groovy step look like?</FONT></SPAN></DIV>
<DIV><SPAN class=3D939491806-12072006><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D939491806-12072006><FONT face=3DArial color=3D#0000ff =

size=3D2>cheers</FONT></SPAN></DIV>
<DIV><SPAN class=3D939491806-12072006><FONT face=3DArial color=3D#0000ff =

size=3D2>Mittie</FONT></SPAN></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid; MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B>=20
  webtest-admin@lists.canoo.com =
[mailto:webtest-admin@lists.canoo.com]<B>On=20
  Behalf Of </B>Michael Dunn<BR><B>Sent:</B> Mittwoch, 12. Juli 2006=20
  0:28<BR><B>To:</B> webtest@lists.canoo.com<BR><B>Subject:</B> =
[Webtest] NTLM=20
  authentication and htmlunit 1.9<BR><BR></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN class=3D256112222-11072006>i =
see that the new=20
  version of webtest (R_1354) includes a new version of htmlunit (1.9) =
where=20
  marc did some work on extending DefaultCredentialsProvider to include =
setting=20
  NTLM credentials. does anyone know how one would utilize this in =
webtest to=20
  login to a NTLM authenticated webpage?</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D256112222-11072006></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN class=3D256112222-11072006>i =
have installed=20
  R_1354 and have tried setting the credentials in a groovy step as well =
as just=20
  passing in the username and password in the invoke statement. neither =
of which=20
  worked for me. any ideas?</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D256112222-11072006></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D256112222-11072006>later,</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN=20
  class=3D256112222-11072006>mikey</SPAN></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <P align=3Dleft><FONT size=3D2><FONT face=3DArial><FONT =
color=3D#008080>Michael=20
  Dunn</FONT> <BR></FONT></FONT><FONT size=3D2><FONT face=3DArial><FONT=20
  color=3D#008080>Product Test Manager</FONT> <BR><FONT=20
  color=3D#008080>Adaptis</FONT> <BR><FONT color=3D#008080>206 342=20
  7478</FONT></FONT></FONT> </P>
  <DIV>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C6A604.48C69F61--