After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 624613 - NTLM fails; seems to be trying to use Basic auth.
NTLM fails; seems to be trying to use Basic auth.
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: HTTP Transport
2.30.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2010-07-17 13:44 UTC by David Woodhouse
Modified: 2012-10-16 14:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test program (1.74 KB, text/plain)
2010-07-17 13:44 UTC, David Woodhouse
Details
curl output (2.93 KB, text/plain)
2010-07-17 13:49 UTC, David Woodhouse
Details
souptest output (1.50 KB, text/plain)
2010-07-17 13:52 UTC, David Woodhouse
Details

Description David Woodhouse 2010-07-17 13:44:09 UTC
Created attachment 166070 [details]
test program

See attached test program. When I run it, it goes into an endless loop trying Basic authentication instead of NTLM -- unless I set $NTLM_ONLY in which case it dies with error 401.

I'm implementing Exchange Web Services, so the URL I'm giving it is http://autodiscover.$COMPANY.com/autodiscover/autodiscover.xml

Using the curl command line tool works fine.

This is the Fedora 13 x86_64 libsoup-2.30.1
Comment 1 David Woodhouse 2010-07-17 13:49:48 UTC
Created attachment 166071 [details]
curl output

This is the output from curl, which runs successfully.
Comment 2 David Woodhouse 2010-07-17 13:52:10 UTC
Created attachment 166072 [details]
souptest output

And this is the output from the souptest program. If I don't set $NTLM_ONLY then it does the same, then goes into an endless loop of failing Basic auth.
Comment 3 David Woodhouse 2010-07-17 13:59:47 UTC
Ah, setting NTLM_USER=$domain\\$username instead of just $username seems to make it work. If unspecified, it was using the domain of the server rather than leaving it empty as curl seems to. I'm not in the same domain as the server.
Comment 4 Dan Winship 2010-07-17 15:13:22 UTC
The infinite loop is because you're telling it to infinitely loop; libsoup will keep re-emitting "authenticate" until you stop authenticating the SoupAuth. So if you only have a single password, you should only call soup_auth_authenticate() when retrying==FALSE.

It's been a long time since I wrote the NTLM code, and I don't remember why it fills in the default domain rather than leaving it blank. I feel like there were sites where leaving it blank caused it to fail though. Or maybe we do it that way because that's what IE does, or because it corresponds to what OWA requires? (If you log in to OWA do you have to include the domain?)

The code I'm about to point you to in bug 587145 includes the ability to disable specific auth types, so you can disable fallback-to-Basic. Although you can also just check the scheme name from the authenticate handler and just ignore it if it's Basic, which will have more or less the same effect.
Comment 5 David Woodhouse 2010-07-17 23:09:48 UTC
This *is* basically OWA. It's the SOAP interface to Exchange.

It only works if I *don't* include the 'default domain', which seems to be the server's domain and not the domain that *my* user is in.

I'd be inclined to suggest that we should copy what cURL does, which is not to include the domain.
Comment 6 Sri Ramkrishna 2012-10-05 05:20:08 UTC
Any update on this?
Comment 7 Dan Winship 2012-10-05 12:52:07 UTC
I guess we could toggle the behavior to "don't include the default domain" in unstable, and see if we get bug reports about that...
Comment 8 Dan Winship 2012-10-05 12:52:57 UTC
oh, and the aforementioned disable-Basic-auth code landed in libsoup a long time ago:

  soup_session_remove_feature_by_type (session, SOUP_TYPE_AUTH_BASIC);
Comment 9 Dan Winship 2012-10-16 14:57:03 UTC
ok, behavior flipped in git master... let's see if anyone notices