git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Re: [QUESTION]Is it possible that git would support two-factor authentication?

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 14, 2021, 22:02 UTC
Message-ID
<nycvar.QRO.7.76.6.2108150001480.59@tvgsbejvaqbjf.bet>
In-Reply-To
<0d301aeafc0b11ebb27d0024e87935e7@oschina.cn>
Hi,
On Fri, 13 Aug 2021, lilinchao@oschina.cn wrote:
Show 20 quoted lines
> >On 8/11/2021 7:00 AM, lilinchao@oschina.cn wrote:
> >> Many websites support two-factor authentication(2FA) to log in, like Github, I wander if we can support it in application layer.
> >> When client clone something, they need  input username and password, it is like a website login process. For security, we can
> >> enable  2FA during this process.
> >
> >Typically, this is handled at the credential helper layer, which
> >is a tool outside of the Git codebase that can more closely work
> >with such 2FA/MFA requirements. For example, GCM Core [1] supports
> >2FA with GitHub, Azure DevOps, and BitBucket.
> >
> >[1] https://github.com/microsoft/Git-Credential-Manager-Core
> >
> >The mechanism is that Git attempts an operation and gets an error
> >code, so it asks for a credential from the helper. The helper
> >then communicates with the server to do whatever authentication
> >is required, including possibly performing multi-factor auth.
> >All of these details are hidden from Git, which is good.
> >
> Indeed, this is good, I've experienced this tool these days at WSL and Windows,
> but finally I hope these features can be supported by Git itself, and then the user end can easily configure it.

The problem here is that 2FA is highly provider-specific. And that's why Git itself refuses to implement it. Hence the credential helper layer.

Ciao, Johannes

Previous: lilinchao@oschina.cnNext: Matthew Cheetham
Message 7 of 8 in “[QUESTION]Is it possible that git would support two-factor authentication?”
  1. lilinchao@oschina.cnAug 11, 2021
  2. Konstantin RyabitsevAug 11, 2021
  3. Theodore Ts'oAug 11, 2021
  4. brian m. carlsonAug 13, 2021
  5. Derrick StoleeAug 11, 2021
  6. lilinchao@oschina.cnAug 13, 2021
  7. Johannes SchindelinAug 14, 2021
  8. Matthew CheethamAug 17, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.