mirror of
https://github.com/YunoHost-Apps/seafile_ynh.git
synced 2024-09-03 20:26:01 +02:00
Use REMOTE_USER var for SSO authentication
This commit is contained in:
parent
7ce62ef84d
commit
4d6149a421
2 changed files with 2 additions and 3 deletions
|
@ -5,7 +5,6 @@ location __PATH__ {
|
|||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Host $server_name;
|
||||
proxy_set_header HTTP_AUTH_USER $remote_user;
|
||||
proxy_read_timeout 1200s;
|
||||
|
||||
# used for view/edit office file via Office Online Server
|
||||
|
@ -50,4 +49,4 @@ location /seafdav {
|
|||
|
||||
access_log /var/log/nginx/seafdav.access.log;
|
||||
error_log /var/log/nginx/seafdav.error.log;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ diff -Naur a/seahub/seahub/auth/middleware.py b/seahub/seahub/auth/middleware.py
|
|||
" before the RemoteUserMiddleware class.")
|
||||
try:
|
||||
- username = request.META[self.header]
|
||||
+ username = request.META["HTTP_AUTH_USER"] + '@' + request.META["HTTP_HOST"]
|
||||
+ username = request.META["HTTP_REMOTE_USER"] + '@' + request.META["HTTP_HOST"]
|
||||
except KeyError:
|
||||
# If specified header doesn't exist then return (leaving
|
||||
# request.user set to AnonymousUser by the
|
||||
|
|
Loading…
Add table
Reference in a new issue