git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] http(s): automatically try NTLM authentication first
@ 2017-02-22 17:39 David Turner
  2017-02-22 20:19 ` Junio C Hamano
  0 siblings, 1 reply; 38+ messages in thread
From: David Turner @ 2017-02-22 17:39 UTC (permalink / raw)
  To: git; +Cc: sandals, Johannes Schindelin, David Turner

From: Johannes Schindelin <johannes.schindelin@gmx.de>

It is common in corporate setups to have permissions managed via a
domain account. That means that the user does not really have to log in
when accessing a central repository via https://, but that the login
credentials are used to authenticate with that repository.

The common way to do that used to require empty credentials, i.e. hitting
Enter twice when being asked for user name and password, or by using the
very funny notation https://:@server/repository

A recent commit (5275c3081c (http: http.emptyauth should allow empty (not
just NULL) usernames, 2016-10-04)) broke that usage, though, all of a
sudden requiring users to set http.emptyAuth = true.

Which brings us to the bigger question why http.emptyAuth defaults to
false, to begin with.

It would be one thing if cURL would not let the user specify credentials
interactively after attempting NTLM authentication (i.e. login
credentials), but that is not the case.

It would be another thing if attempting NTLM authentication was not
usually what users need to do when trying to authenticate via https://.
But that is also not the case.

So let's just go ahead and change the default, and unbreak the NTLM
authentication. As a bonus, this also makes the "you need to hit Enter
twice" (which is hard to explain: why enter empty credentials when you
want to authenticate with your login credentials?) and the ":@" hack
(which is also pretty, pretty hard to explain to users) obsolete.

This fixes https://github.com/git-for-windows/git/issues/987

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: David Turner <dturner@twosigma.com>
---
This has been in git for Windows for a few months (without the
config.txt change).  We've also been using it internally.  So I think
it's time to merge back to upstream git.

 Documentation/config.txt | 3 ++-
 http.c                   | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index fc5a28a320..b0da64ed33 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1742,7 +1742,8 @@ http.emptyAuth::
 	Attempt authentication without seeking a username or password.  This
 	can be used to attempt GSS-Negotiate authentication without specifying
 	a username in the URL, as libcurl normally requires a username for
-	authentication.
+	authentication.  Default is true, since if this fails, git will fall
+	back to asking the user for their username/password.
 
 http.delegation::
 	Control GSSAPI credential delegation. The delegation is disabled
diff --git a/http.c b/http.c
index 90a1c0f113..943e630ea6 100644
--- a/http.c
+++ b/http.c
@@ -109,7 +109,7 @@ static int curl_save_cookies;
 struct credential http_auth = CREDENTIAL_INIT;
 static int http_proactive_auth;
 static const char *user_agent;
-static int curl_empty_auth;
+static int curl_empty_auth = 1;
 
 enum http_follow_config http_follow_config = HTTP_FOLLOW_INITIAL;
 
-- 
2.11.GIT


^ permalink raw reply related	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2017-02-28 10:21 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-22 17:39 [PATCH] http(s): automatically try NTLM authentication first David Turner
2017-02-22 20:19 ` Junio C Hamano
2017-02-22 21:04   ` David Turner
2017-02-22 21:16     ` Junio C Hamano
2017-02-22 21:34       ` Jeff King
2017-02-23 17:08         ` Johannes Schindelin
2017-02-23 19:06           ` Junio C Hamano
2017-02-23 19:42           ` Jeff King
2017-02-23 20:37             ` Junio C Hamano
2017-02-23 20:48               ` Jeff King
2017-02-25 11:51                 ` Johannes Schindelin
2017-02-22 23:34     ` brian m. carlson
2017-02-22 23:42       ` Jeff King
2017-02-23  2:15         ` Junio C Hamano
2017-02-23 19:11         ` Junio C Hamano
2017-02-23 19:35           ` Jeff King
2017-02-23  1:03       ` David Turner
2017-02-23  4:19         ` brian m. carlson
2017-02-23  9:13         ` Mantas Mikulėnas
2017-02-22 21:06   ` Jeff King
2017-02-22 21:25     ` Junio C Hamano
2017-02-22 21:35       ` Jeff King
2017-02-22 21:57         ` Junio C Hamano
2017-02-22 21:58           ` Jeff King
2017-02-22 22:35             ` Junio C Hamano
2017-02-22 23:33               ` Jeff King
2017-02-22 23:34                 ` [PATCH 1/2] http: restrict auth methods to what the server advertises Jeff King
2017-02-22 23:40                 ` [PATCH 2/2] http: add an "auto" mode for http.emptyauth Jeff King
2017-02-23  1:16                   ` David Turner
2017-02-23  1:37                     ` Jeff King
2017-02-23 16:31                       ` David Turner
2017-02-23 19:44                         ` Jeff King
2017-02-23 20:05                           ` David Turner
2017-02-25 11:48                       ` Johannes Schindelin
2017-02-25 19:15                         ` Jeff King
2017-02-25 19:18                           ` [PATCH] " Jeff King
2017-02-27 18:35                             ` Junio C Hamano
2017-02-28 10:18                               ` Johannes Schindelin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).