Unable to authorize drone with gitea, client ID not registered

I cannot seem to integrate drone to gitea, it always fail at authorizing part. This is the relevant log from gitea log.

2023/03/14 00:21:20 ...rs/web/auth/oauth.go:824:handleAuthorizeError() [W] [640f5b90] Authorization failed: Client ID not registered

I’ve sure there was no mistyping on both client ID and client secret, this is my /etc/drone.env.

DRONE_SERVER_HOST=drone.company.net
DRONE_SERVER_PROTO=https
DRONE_GITEA_CLIENT_ID="f413ncad-7460-4216-821a-5sb219a85c71"
DRONE_GITEA_CLIENT_SECRET="REDACTED"
DRONE_GITEA_SERVER=https://git.company.net
DRONE_GIT_ALWAYS_AUTH=true
DRONE_RPC_SECRET=REDACTED

This is how I launch my drone instance (using docker).

docker run \
--name=drone --detach \
--restart=always \
--env-file=/etc/drone.env \
--publish=127.0.0.1:7410:80 \
--publish=127.0.0.1:7415:443 \
drone/drone:2

Thanks for any help, I’m completely lost.

I have fix the problem, it turns out you can’t have quotes around environment variable. I remove quotes on DRONE_GITEA_CLIENT_ID and DRONE_GITEA_CLIENT_SECRET, it’s now working.

2 Likes