Authenticating to gitea from git after switch to using OID authentication
-
After the recent app update that switched to using open ID (OID) my local git was not able to authenticate with gitea.
If you login to the gitea website, click on your profile image on the top right, and then select Settings.
From the Settings screen select the Applications side menu option and then under Generate New Token, enter a token name, expand the select permissions, and in my case I gave it all permissions, you can probably get away with Repository and Organization but I haven't tested to confirm.Click Generate token and then save the generated token so you can refer to it later.
Now do something like a
git pull
from a repo with gitea as the remote and when asked for the username use your cloudron username, and for the password use the access token.I could be mistaken and I just happened to be dealing with another issue at the same time and this isn't related to the OID update and we can just delete this post if it isn't relevant but I didn't want to leave the next person without tracks in the sand if this is in fact going to happen to everyone who were using gitea and using the a username and password before but now need to use OID.
-
@nebulon That is probably a great idea, I have not used this before.
I have gone to Gitea, go to Settings, and on the left hand menu select SSH/GPG Keys it gives me the ability to add an existing SSH public key.
It also says that "SSH is currently disabled so these keys are only used for commit signature verification"
It does look like there is an option to enable the SSH port under the Location settings of the app so to make this work the way your describing I believe someone would need to:
- Install Gitea
- Enable Location > SSH port
- Generate ssh key pair using
ssh-keygen
- Open Gitea > Settings > SSH/GPG keys
- Click Add Key and add the public key portion of your generated ssh key and click Add Key button at the bottom
Given that SSH isn't enabled by default, that there are additional steps and tools needed, and that there is no way to do OID login via the git cli tool (that I know of) it seems like the Generate Token option would be the expected default choice for new users of gitea on cloudron with more advanced or experienced users going through the additional steps to use SSH if that is more consistent with their workflow.