2

I've set up an account on a Gitea instance using the "Sign in with GitHub" feature, and that account has been given write access to a Gitea repository. When I try to push local changes to Gitea (using my shared GitHub and Gitea username), I'm prompted for a password. Giving my GitHub access token or password leads to the "authentication failed" message.

  • As a "Sign in with GitHub" user, can I push to Gitea from a local repository? If so, how?

The next thing I plan to try is setting a password for the Gitea account, using the User settingsAccount control panel. I'm not sure whether I can do this, since it requires me to enter a current Gitea password, which I don't have—and I'm worried that attempting to do it might screw up my existing ability to sign in with GitHub.

  • As a "Sign in with GitHub" user, can I set a Gitea password? If so, how?

I can't find any documentation of the "Sign in with GitHub" feature. Searching for documentation about external users and pushing with OAuth also turns up nothing.

  • Where's the documentation for the "Sign in with GitHub" feature?

2 Answers 2

1

To answer the original question's first bullet point:

Make sure that you have cloned the repository using the SSH url from gitea, not the HTTP URL. You will need to create a key pair, labeled with the email address that the gitea instance has on record for you, and add the public key to your gitea account using the web interface. (On the top right dropdown that has to do with your account/login, select "Settings", then on the left select "SSH/GPG keys", and then use the "Add Key" button under "Manage SSH Keys" facility.) Then you should be able to push to the repository, assuming you have write access to it.

1
  • Thanks for helping me work this out, and for writing up the solution! (For transparency: Glen had a bit of an advantage, because he's the instance administrator. 😼️)
    – Vectornaut
    Commented Jan 28 at 4:29
3

Take a look at the output from gitea admin user list and gitea admin auth list

There are examples of how to add github oauth to gitea in their documentation here: https://docs.gitea.com/administration/command-line#admin, but I'm not sure what is set up by default.

You can also set a user's password manually with gitea admin user change-password --username myname --password asecurepassword.

It looks like you should be able to log in using a generated access token as the password if nothing else. Gitea doesn't support 2fa for example, so this is the fallback: https://docs.gitea.com/usage/multi-factor-authentication

3
  • This looks great! When you say "examples of how to add GitHub OAuth to Gitea," do you mean the gitea admin auth add-oauth --name external-github --provider github --key OBTAIN_FROM_SOURCE --secret OBTAIN_FROM_SOURCE example? I couldn't find any others.
    – Vectornaut
    Commented Jan 26 at 19:27
  • I'm confused about the statement that Gitea doesn't support two-factor authentication, because the linked documentation says: "Gitea supports both TOTP (Time-based One-Time Password) tokens and FIDO-based hardware keys using the Webauthn API. MFA can be configured within the 'Security' tab of the user settings page." It doesn't mention access tokens as a fallback. Could you clarify?
    – Vectornaut
    Commented Jan 26 at 19:28
  • 1
    @Vectornaut yes that's the example. I read it a bit too quickly, their interface for Git HTTP using Git CLI is what doesn't support MFA.
    – Cpt.Whale
    Commented Jan 26 at 20:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .