-
Notifications
You must be signed in to change notification settings - Fork 535
TokenAuth not working as expected #999
Comments
It seems to me that this work as intended: GitHub accepts using personal access token with basic HTTP authentication (that is go-git's Most modern git hostings recommend using HTTP's basic user:pass authentication for OAuth2 tokens. However, this varies from host to host. GitHub uses All of these use cases should be handled with go-git's go-git's I would recommended removing |
@smola I think removing At least for me, it added much more confusion because I really didn't understand the use case, because like you said, providers such as GitHub, BitBucket and GitLab support basic HTTP auth. You can close this issue if you want or leave it open for when this gets addressed in go-git v5. |
@mcuadros Should we update |
Uh oh!
There was an error while loading. Please reload this page.
I expect the following to clone a private repository using a personal access token.
git clone https://github.com/mccurdyc/private-repo simple --recursive error: unexpected client error: unexpected requesting "https://github.com/user/private-repo/info/refs?service=git-upload-pack" status code: 400
It looks like GitHub should support it:
https://blog.github.com/2012-09-21-easier-builds-and-deployments-using-git-over-https-and-oauth/
As a side note, looks like the following work:
The current implementation of
TokenAuth
in go-git does something similar to 2, except would only work for GitHub's API and not for cloning.@smola added some context to this previously here
Also, this goplayground example aligns with the GitHub post in that you would send the token as username.
The text was updated successfully, but these errors were encountered: