External OpenID Login + whitelisted on protected branch - can't push #6965

Closed
opened 2025-11-02 07:12:16 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @llitz on GitHub (Mar 4, 2021).

Hi,

I am running the latest version of gitea on docker with authentication only through OpenID (keycloak)
Everything seemed to work fine until I enabled branch protection on the master branch and whitelisted my user.

When I try to push, I receive the following:

gitea       | Accepted publickey for git from 172.18.0.1 port 34578 ssh2: RSA SHA256:QjeUCId0aytppm4uxta+D5hA/yzShfyjoy9RNqUS5fQ
gitea       | 2021/03/03 20:26:54 Started GET /api/internal/serv/command/1/salesdemo/deployenv?mode=2&verb=git-receive-pack for 127.0.0.1:40184
gitea       | 2021/03/03 20:26:54 Completed GET /api/internal/serv/command/1/salesdemo/deployenv?mode=2&verb=git-receive-pack 200 OK in 13.147391ms
gitea       | 2021/03/03 20:26:55 Started POST /api/internal/hook/pre-receive/salesdemo/deployenv for 127.0.0.1:40186
gitea       | [git-module] /data/git/repositories/salesdemo/deployenv.git: /usr/bin/git -c credential.helper= -c protocol.version=2 -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= rev-list --max-count=1 b614e3353445c87e3788316f84c68b6a850f5c1f ^306ff0948865be2556cf7136be90309210664724
gitea       | 2021/03/03 20:26:55 ...ters/private/hook.go:286:HookPreReceive() [W] Forbidden: User 1 is not allowed to push to protected branch: master in 8:salesdemo/deployenv
gitea       | 2021/03/03 20:26:55 Completed POST /api/internal/hook/pre-receive/salesdemo/deployenv 403 Forbidden in 16.341331ms

I thought it could be something related to ssh, but if that were the case I wouldn't be able to push to the other branches in the private repository.
The system correctly identifies all my other pushes, including to an unprotected branch in the same repository.

Originally created by @llitz on GitHub (Mar 4, 2021). Hi, I am running the latest version of gitea on docker with authentication only through OpenID (keycloak) Everything seemed to work fine until I enabled branch protection on the master branch and whitelisted my user. When I try to push, I receive the following: ``` gitea | Accepted publickey for git from 172.18.0.1 port 34578 ssh2: RSA SHA256:QjeUCId0aytppm4uxta+D5hA/yzShfyjoy9RNqUS5fQ gitea | 2021/03/03 20:26:54 Started GET /api/internal/serv/command/1/salesdemo/deployenv?mode=2&verb=git-receive-pack for 127.0.0.1:40184 gitea | 2021/03/03 20:26:54 Completed GET /api/internal/serv/command/1/salesdemo/deployenv?mode=2&verb=git-receive-pack 200 OK in 13.147391ms gitea | 2021/03/03 20:26:55 Started POST /api/internal/hook/pre-receive/salesdemo/deployenv for 127.0.0.1:40186 gitea | [git-module] /data/git/repositories/salesdemo/deployenv.git: /usr/bin/git -c credential.helper= -c protocol.version=2 -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= rev-list --max-count=1 b614e3353445c87e3788316f84c68b6a850f5c1f ^306ff0948865be2556cf7136be90309210664724 gitea | 2021/03/03 20:26:55 ...ters/private/hook.go:286:HookPreReceive() [W] Forbidden: User 1 is not allowed to push to protected branch: master in 8:salesdemo/deployenv gitea | 2021/03/03 20:26:55 Completed POST /api/internal/hook/pre-receive/salesdemo/deployenv 403 Forbidden in 16.341331ms ``` I thought it could be something related to ssh, but if that were the case I wouldn't be able to push to the other branches in the private repository. The system correctly identifies all my other pushes, including to an unprotected branch in the same repository.
Author
Owner

@llitz commented on GitHub (Mar 4, 2021):

I am closing this issue. Apparently the system had a duplicated user and the key was assigned to the other user.

@llitz commented on GitHub (Mar 4, 2021): I am closing this issue. Apparently the system had a duplicated user and the key was assigned to the other user.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6965