Push failing when using reverse proxy (IIS) - could be oauth issue

Our server is sat behind an IIS reverse proxy, entirely within a local network. The IIS deals with https requests and just sends http requests to the server.

Client is on the local network

Fetch works, vscode can download the git and history

Trying to push opens the oauth dialog

the git credential manager is then added to the server

but then push hangs?

The logs appear to tell a story of the client being authorized

router: completed POST /login/oauth/grant for [134.219.128.90:11810]:0,

but every time the push command is run after cancelling the prompt to add an oauth application pops up again.

The redirect url could be wrong? could one of the firewalls on the server be incorrectly set up?

The server was setup following the reverse proxy guide and the setup is as follows

[server]
SSH_DOMAIN = localhost
DOMAIN = localhost
HTTP_PORT = 3000
ROOT_URL = https://git.our.domain/

where git.our.domain is actually the correct domain name that has self signed certificates that are trusted locally

Once “authorize application” is clicked it redirects to my login landing screen, and the push just sits there,

digging deeper in to the client logs -

trace: run_command: 'git credential-manager get'

begins and I assume sits and awaits a response from the server but potentially never gets any? I am unsure of how to test this?

Ideas on a fix would be very appreciated

Two separate things here.

  1. The OAuth popup is Git Credential Manager (GCM) trying its OAuth flow against Gitea, and your push hangs because the token is never handed back to git. The simplest fix is to stop GCM from using OAuth for this host and use a Gitea access token (Settings > Applications > Generate New Token, with write:repository scope) as the password. You can force the generic provider with `git config --global credential.https://git.our.domain.provider generic`, then clear any stale entry with `git credential-manager erase` (or remove it in Windows Credential Manager) and push again; enter your username and the token as the password.

  2. Your `[server]` section is wrong for a proxied setup. `DOMAIN = localhost` and `SSH_DOMAIN = localhost` make Gitea generate wrong clone URLs and can break OAuth redirects. Use:

```

[server]

DOMAIN = git.our.domain

SSH_DOMAIN = git.our.domain

ROOT_URL = https://git.our.domain/

HTTP_ADDR = 0.0.0.0

HTTP_PORT = 3000

```

Restart Gitea afterwards. Also make sure IIS (ARR) forwards the original host (set `preserveHostHeader` to true in the ARR proxy settings) and `X-Forwarded-Proto: https`, and that request limits do not truncate pushes (`maxAllowedContentLength` in request filtering, and a large enough ARR timeout). Fix the credential and domain items first.