thebaselab / codeapp

Building a full-fledged code editor for iPad
https://code.thebaselab.com
MIT License
2.7k stars 178 forks source link

Unable to configure GitHub credentials using Key Based Credentials Authentication #1067

Closed nichelia closed 1 month ago

nichelia commented 1 month ago

Hi, I have recently downloaded the app (1.7.1) and tried to configure my private GitHub using Key Based Credentials.

I have successfully created a public and private key pair on GitHub but when I add it to the app, it does not seem to work.

I have set the hostname to github.com and assigned the public key and private key respectively.

When I try to add a repository with git@github.com:/.git I get the error: Clone error: authentication callback returned unsupported credentials type

When I try to add a repository with https://github.com//.git I get the error: Authentication failed: Check your credentials configuration.

Has anyone managed to connect to GitHub using SSH?

cjscode commented 1 month ago

I have. I ran into numerous problems getting it to work, but I finally did.

From what I understand your problem is, here are the steps and things that I followed to fix my problem:

  1. Settings > Author Identity: Add your username and accociated email.
  2. Settings > Authentication: Add your username and key under password based auth. Then under hostname based creds, add github.com.
  3. Now clone the repo using the url.

These steps worked for me and I think they might help you. If you need any more help, please let me know.

nichelia commented 1 month ago

@cjscode I got it working by using a Personal Token.

However, I am curious at your solution. Did you also use a Personal Token or you used the ssh key under the password based auth? Also, when cloning the repo(s) did you use ssh or https to get it to work?

Thank you for the suggestion :)

bummoblizard commented 1 month ago

@nichelia The correct url for cloning GitHub repositories using SSH is ssh://git@github.com/<user>/<repository name>.git.

nichelia commented 1 month ago

@bummoblizard hey thank you for the clarification. I should have mentioned that I have tried that too.

Adding ssh:// does not do the trick unfortunately. I get the same unsupported credentials type error.

bummoblizard commented 1 month ago

Thanks for letting me know. Please make sure it is ssh://git@github.com/<user>/<repository name>.git instead of ssh://git@github.com:<user>/<repository name>.

If it still doesn't work, consider generating a new pair of key using ed25519 or using a personal access token. A ed25519 key-pair can be generated using ssh-keygen -t ed25519 in the terminal.

nichelia commented 1 month ago

@bummoblizard actually, re-adding keys to GitHub and App and adding the repo as you mentioned work for me now.

Maybe I did a typo the first time. Thank you!🤩

Will close ticket.