[go: up one dir, main page]

Skip to content

Documentation: How to authenticate with Git HTTPS when using 2FA

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

When a user enables 2FA we prevent then from cloning/fetchingp/pushing using their username and password credentials with Git over HTTPS. When they try to do so, they get an error message on their terminal telling them how to enable a personal token and how to use that.

This is not documented anywhere in our documentation page.

Further details

When I was trying to look for that information to refer in a MR review, the only content I found about this was in a non-gitlab page:

The instructions above are accurate. The other reference I could find in our documentation page is in the push mirror category: https://docs.gitlab.com/ee/user/project/repository/repository_mirroring.html#setting-up-a-push-mirror-to-another-gitlab-instance-with-2fa-activated

Proposal

Document the Git over HTTPS authentication part how it works, how to use a personal token, when that is required/desirable (I believe you can always use despite 2FA being enabled, but when it is, it's mandatory).

When you have 2FA, the ideal workflow is to use SSH keys instead, but that is not always possible due to firewall restrictions.

Who can address the issue

Anyone with Git knowleadge.

Other links/references

Edited by 🤖 GitLab Bot 🤖