some time ago, I wrote an article about authentication against Git repositories with JGit (a pure Java Git implementation). Now I am about to update a section about the authentication methods provided by GitLab and how they work.
From my understanding, Oauth tokens (those managed under Profile Settings > Applications) can be used to access private repositories. So I created a private repository and an Application named
foo for testing. The secret generated by GitLab is
a1b2c3. However, attempting to clone the repository with
git clone https://foo:email@example.com/user/repo.git
gave me this error
I also tried these variants
git clone https://oauth2:firstname.lastname@example.org/user/repo.git git clone https://email@example.com/user/repo.git git clone https://firstname.lastname@example.org/user/repo.git password: a1b2c3
But all resulted in the same error.
The experiments described here were all made with GitLab community edition (gitlab.com). Is my assumption that Oauth can be used to authenticate against repositories wrong? Or can someone give me a hint what I am doing wrong?
Thanks in advance,