0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-12 16:42:11 +01:00
gitea/services/auth
Hasnain Lakhani 64c3d55de7
Add support for authentication based on reverse proxy email (#19949)
This is useful in scenarios where the reverse proxy may have knowledge
of user emails, but does not know about usernames set on gitea,
as in the feature request in #19948.

I tested this by setting up a fresh gitea install with one user `mhl`
and email `m.hasnain.lakhani@gmail.com`. I then created a private repo,
and configured gitea to allow reverse proxy authentication.

Via curl I confirmed that these two requests now work and return 200s:

curl http://localhost:3000/mhl/private -I --header "X-Webauth-User: mhl"
curl http://localhost:3000/mhl/private -I --header "X-Webauth-Email: m.hasnain.lakhani@gmail.com"

Before this commit, the second request did not work.

I also verified that if I provide an invalid email or user,
a 404 is correctly returned as before

Closes #19948

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2022-09-28 02:00:15 +02:00
..
source Fix typo in source (#20723) 2022-08-09 09:53:40 +08:00
auth_test.go
auth.go
basic.go Move some files into models' sub packages (#20262) 2022-08-25 10:31:57 +08:00
group.go Share HTML template renderers and create a watcher framework (#20218) 2022-08-28 10:43:25 +01:00
httpsign.go
interface.go Share HTML template renderers and create a watcher framework (#20218) 2022-08-28 10:43:25 +01:00
oauth2.go Move some files into models' sub packages (#20262) 2022-08-25 10:31:57 +08:00
reverseproxy.go Add support for authentication based on reverse proxy email (#19949) 2022-09-28 02:00:15 +02:00
session.go
signin.go
source.go
sspi_windows.go Share HTML template renderers and create a watcher framework (#20218) 2022-08-28 10:43:25 +01:00
sync.go