OAuth2 and ReverseProxy behavior is different when using email as user #11489

Open
opened 2025-11-02 09:39:11 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @maordavidov on GitHub (Aug 21, 2023).

Description

When using oauth2_client configuraiton, there is an option to use email in the USERNAME field.
The implementation uses Split functionality like speficied here

While using ReverseProxy, I'm unable to use security.REVERSE_PROXY_AUTHENTICATION_USER = X-Auth-Request-Email the reason is it fails on the field validation and returns nil user (actually, the user looks like he is not connected) I think the relevant implementation is here

The users I'm receiving has a long user id name and I guess it's not the desired behavior.

Gitea Version

1.20.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

image

Git Version

No response

Operating System

No response

How are you running Gitea?

Helm chart, in Kubernetes

Database

SQLite

Originally created by @maordavidov on GitHub (Aug 21, 2023). ### Description When using `oauth2_client` configuraiton, there is an option to use `email` in the `USERNAME` field. The implementation uses Split functionality like speficied [here](https://github.com/go-gitea/gitea/blob/main/routers/web/auth/auth.go#L359) While using ReverseProxy, I'm unable to use `security.REVERSE_PROXY_AUTHENTICATION_USER = X-Auth-Request-Email` the reason is it fails on the field validation and returns nil user (actually, the user looks like he is not connected) I think the relevant implementation is [here](https://github.com/go-gitea/gitea/blob/main/services/auth/reverseproxy.go#L38) The users I'm receiving has a long user id name and I guess it's not the desired behavior. ### Gitea Version 1.20.2 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots ![image](https://github.com/go-gitea/gitea/assets/14234032/01ad575d-f8dc-4d17-8f5d-f4ce223f1768) ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Helm chart, in Kubernetes ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 09:39:11 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11489