]> source.dussan.org Git - jgit.git/commit
Detects background authentication and force use of jgit authentication 87/22487/3
authorLaurent Goujon <lgoujon@twitter.com>
Mon, 24 Feb 2014 21:23:00 +0000 (13:23 -0800)
committerChris Aniszczyk <caniszczyk@gmail.com>
Wed, 21 May 2014 15:29:57 +0000 (10:29 -0500)
commit0e7622a9151e2247c95acec366e3f911e80f5764
tree8cceb10f833bae2bb3863152820738d16d9d7ebf
parentff9c194b8a3b8f21b46d77b491f5372365f69b43
Detects background authentication and force use of jgit authentication

Sun HttpURLConnection is able to handle authentication like SPNEGO without
caller intervention. However, there are some restrictions:
- do not need user direct input (user,password for example)
- it doesn't work when request body is chunked/streamed (because it cannot be
replayed)

Unfortunately there is no real way to leverage HttpURLConnection authentication
work as the authentication header is stripped off the request before returning
to the caller. There's also no way to explicitly disable authentication in
HttpURLConnection (SPNEGO auth will always be attempted if a valid token can be
created by GSSAPI).

This is an issue for jgit since it is expected that the first request will be
used to detect authentication method, and reuse for the subsequent requests.

This patch modifies TransportHTTP to detect authentication done in the background
by HttpURLConnection and sets the jgit authentication method accordingly so it will
always work for future requests (assuming that the authentication method used by
HttpURLConnection is also supported by jgit).

Bug: 428836
Change-Id: I79f3b70ca2b8377e20da8e6a01914e43e96595ce
Signed-off-by: Laurent Goujon <lgoujon@twitter.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java