MXUnit Ant task and NTLM authentication

183 views
Skip to first unread message

christop...@escg.jacobs.com

unread,
Aug 22, 2009, 7:28:53 PM8/22/09
to mxunit
I am trying to use the mxunit ant task on a site with NTLM
authentication. The docs said using authMethod="ntlm" should work but
it does not. I get a 401 Authentication error. The ant task returns:

org.apache.commons.httpclient.HttpMethodDirector
isAuthenticationNeeded
Authentication requested but doAuthentication is disabled


I use HttpClient to replace CF's native client because of CFHTTP's
inability to handle NTLM and it works fine now so I now HttpClient
works.

Any ideas?

bill shelton

unread,
Aug 23, 2009, 5:11:44 AM8/23/09
to mxunit
I'm out of town at the moment and don't have Windows machine
configured for testing, but I can take a peak when I get back around
the 1st. I'm in the same boat at work and need to use NTLM all over
the place and use HttpClient to handle NTLM.

I'll be able to get this addressed quickly when I get back, if you can
hang on for a few more days. In the meantime, and anonymous or basic
virtual directory should work, if you can make that happen.

best,
bill

On Aug 22, 7:28 pm, "loosecanno...@yahoo.com"

bill shelton

unread,
Aug 23, 2009, 5:18:01 AM8/23/09
to mxunit

Marc Esher

unread,
Aug 24, 2009, 7:46:31 AM8/24/09
to mxu...@googlegroups.com
is it possible that this is due to using ntlmv2? Unless something has changed, I'm pretty sure httpclient only handles v1

christop...@escg.jacobs.com

unread,
Aug 24, 2009, 10:34:28 AM8/24/09
to mxunit
I don't really know about that. All I know is that we used HttpClient
with CF 8 and overwrote the one in their jars so that CFHTTP would
work with NTLM properly. That was about a year ago or more. So
unless mxunit ships with a much older one I would expect it to be the
same. We are using II6. If there is a setting I can check let me
know. Thanks.

On Aug 24, 6:46 am, Marc Esher <marc.es...@gmail.com> wrote:
> is it possible that this is due to using ntlmv2? Unless something has
> changed, I'm pretty sure httpclient only handles v1
>
> On Sun, Aug 23, 2009 at 5:18 AM, bill shelton <vir...@gmail.com> wrote:
>
> > FYI: Issue raised -http://code.google.com/p/mxunit/issues/detail?id=157

christop...@escg.jacobs.com

unread,
Aug 24, 2009, 10:34:49 AM8/24/09
to mxunit
Sure no problem.

Chris

christop...@escg.jacobs.com

unread,
Aug 24, 2009, 10:35:36 AM8/24/09
to mxunit
Ok. I wasn't sure if it was something I was doing or not...so I can
assume it is a real problem then?

On Aug 23, 4:18 am, bill shelton <vir...@gmail.com> wrote:
> FYI: Issue raised -http://code.google.com/p/mxunit/issues/detail?id=157

christop...@escg.jacobs.com

unread,
Aug 24, 2009, 10:42:17 AM8/24/09
to mxunit
Unforunately, I don't control the servers (they are NASA run) which
makes
changing the authentication a laborious process if they will even do
it.
I tried to do anonymous locally on just the mxunit folder and my tests
folder
just to see if it would work at all but IIS didn't seem to want to let
go of the authentication
(different problem) but since I doubt I can make that change on the
servers anyway
I didn't pursue it further. If it looks like that is going to be the
only option long term
then I will have to reconsider.

bill shelton

unread,
Aug 29, 2009, 11:02:26 PM8/29/09
to mxunit
Chris,

Back from the beach and peeping the code now. I should be able to test
it against the NTLM beast Monday. It looks like I might need to grab
some additional info, like the domain. How about I create a separate
attribute that you would need to complete when doing NTLM
authentication:

<mxunittask server="someserver"
authmethod="ntlm"
username="foo"
password="bar"
domain="DOMAIN">


Let me know. I should be able to bang it early next week.

bill

Marc Esher

unread,
Aug 30, 2009, 8:51:59 AM8/30/09
to mxu...@googlegroups.com
I thought with ntlm you could pass the domain as part of the username. no?

christop...@escg.jacobs.com

unread,
Aug 31, 2009, 3:07:23 PM8/31/09
to mxunit
I can do that but like the other poster stated, usually you can say
DOMAIN\userid for the username.

Either way the result is the same. Thanks.

Chris

bill shelton

unread,
Sep 1, 2009, 2:05:21 PM9/1/09
to mxunit
Chris,

I should have something for you shortly. What would be your preferred
method of delivery - email ... SVN?

bill

bill shelton

unread,
Sep 1, 2009, 4:55:03 PM9/1/09
to mxunit
Chris, Try this and let me know if it works for you ...

http://mxunit.googlecode.com/svn/org.mxunit.ant.idea/trunk/mxunit-ant.jar

I was able to test it at work and it works with NTLM.

bill

bill shelton

unread,
Sep 2, 2009, 6:46:08 AM9/2/09
to mxunit
By the way, the syntax for authentication is

<mxunittask server="someserver"
authmethod="ntlm"
username="DOMAIN\USERNAME"
password="bar">

If you use a properties files, you'll need to escape the backslash;
e.g.,

#build.properties
username=DOMAIN\\USERNAME
password=p@$$w0rD
...


bill

On Sep 1, 4:55 pm, bill shelton <vir...@gmail.com> wrote:
> Chris, Try this and let me know if it works for you ...
>
> http://mxunit.googlecode.com/svn/org.mxunit.ant.idea/trunk/mxunit-ant...
Reply all
Reply to author
Forward
0 new messages