Re: OAuth2 support in git?

2018-06-19 Thread Jeff King
On Tue, Jun 19, 2018 at 02:36:50PM +0200, Christian Halstrick wrote: > What is not clear to me is how we can make use of the servers initial > response in order control which credential helper to call and how to > transport the credentials. I don't think we'd ever decide _which_ credential

Re: OAuth2 support in git?

2018-06-19 Thread Christian Halstrick
What is not clear to me is how we can make use of the servers initial response in order control which credential helper to call and how to transport the credentials. Imagine we try to clone over http. The initial request sent to the server may not contain a "Authorization: ..." header and the

Re: OAuth2 support in git?

2018-06-18 Thread Jeff King
On Mon, Jun 18, 2018 at 08:53:27AM -0700, Junio C Hamano wrote: > > Yeah, that will work for some cases. A few places it might not: > > > > - some people may want to provide this only in response to a 401 > > > > - some tokens may need to be refreshed, which would require interacting > >

Re: OAuth2 support in git?

2018-06-18 Thread Junio C Hamano
Jeff King writes: > On Sun, Jun 17, 2018 at 01:37:24PM +0200, Johannes Schindelin wrote: > >> > If it's just a custom Authorization header, we should be able to support >> > it with existing curl versions without _too_ much effort. >> >> Indeed. Because it is already implemented: >> >>

Re: OAuth2 support in git?

2018-06-17 Thread Jeff King
On Sun, Jun 17, 2018 at 01:37:24PM +0200, Johannes Schindelin wrote: > > If it's just a custom Authorization header, we should be able to support > > it with existing curl versions without _too_ much effort. > > Indeed. Because it is already implemented: > > git -c

Re: OAuth2 support in git?

2018-06-17 Thread Johannes Schindelin
Hi Peff, On Thu, 14 Jun 2018, Jeff King wrote: > On Thu, Jun 14, 2018 at 10:13:42AM +, brian m. carlson wrote: > > > > I know that other git server environments like github support that on > > > client side by allowing tokens to be used as usernames in a BASIC > > > authentication flow. We

Re: OAuth2 support in git?

2018-06-14 Thread brian m. carlson
On Thu, Jun 14, 2018 at 11:15:07AM -0400, Jeff King wrote: > On Thu, Jun 14, 2018 at 10:13:42AM +, brian m. carlson wrote: > > There isn't any support for Bearer authentication in Git. For HTTP, we > > use libcurl, which doesn't provide this natively. While it could in > > theory be added,

Re: OAuth2 support in git?

2018-06-14 Thread Jeff King
On Thu, Jun 14, 2018 at 04:46:10PM -0400, Randall S. Becker wrote: > > I suspect (2) would fit in with the existing code better, as the special > > case > > would mostly be limited to the manner in which we feed the credential to > > curl. And you could probably just set a config option for

RE: OAuth2 support in git?

2018-06-14 Thread Randall S. Becker
On June 14, 2018 11:15 AM, Jeff King wrote: > On Thu, Jun 14, 2018 at 10:13:42AM +, brian m. carlson wrote: > > > > I know that other git server environments like github support that > > > on client side by allowing tokens to be used as usernames in a BASIC > > > authentication flow. We could

Re: OAuth2 support in git?

2018-06-14 Thread Jeff King
On Thu, Jun 14, 2018 at 10:13:42AM +, brian m. carlson wrote: > > I know that other git server environments like github support that on > > client side by allowing tokens to be used as usernames in a BASIC > > authentication flow. We could do the same but I am asking whether > > there is also

Re: OAuth2 support in git?

2018-06-14 Thread brian m. carlson
On Thu, Jun 14, 2018 at 10:09:39AM +0200, Christian Halstrick wrote: > Can I use native git as client to contact a git server which does > authentication with OAuth2 Client Credentials Grant [1]? > > Background: We are running gerrit based git servers [2] in a cloud > environment. That

OAuth2 support in git?

2018-06-14 Thread Christian Halstrick
Can I use native git as client to contact a git server which does authentication with OAuth2 Client Credentials Grant [1]? Background: We are running gerrit based git servers [2] in a cloud environment. That environment supports OAuth2 authorization for the apps running in the cloud. The idea is