Logout link is empty in environment-variable mode without login form (regression from #1235)

Đang mở Phù hợp với người mới
#1,276 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
65/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
authentication

Hướng nghiên cứu

Bắt đầu bằng cách đọc UserBackend::getLogoutUrl() và thay đổi trong #1235, sau đó kiểm tra cách nhận diện chế độ biến môi trường và cách kiểm thử URL đăng xuất. Tái hiện liên kết trống khi dùng chế độ biến môi trường, không có URL SLO và biểu mẫu đăng nhập bị tắt. Hoàn tất khi mục đăng xuất trỏ đến core.login.logout kèm mã thông báo yêu cầu trong cấu hình đó, đồng thời hành vi SAML hiện có vẫn được kiểm thử.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

0. Needs triage bug

Nextcloud version: 34.0.3
user_saml version: 8.5.0
Mode: type = environment-variable (identity from a header set by a reverse proxy), no SLO URL, general-nextcloud_login_form unset (false).

Steps to reproduce
  1. Configure user_saml in environment-variable mode behind an authenticating reverse proxy (here oauth2-proxy + Caddy forward_auth). /login is protected by the proxy.
  2. Do not set idp-singleLogoutService.url. Do not enable the Nextcloud login form.
  3. Log in, open the user menu and inspect « Log out ».
Expected

The logout entry points to core.login.logout with a request token. The Nextcloud session is destroyed, and the proxy then ends its own session. In our case the reverse proxy rewrites the post-logout redirect to the proxy sign-out endpoint.

Actual

href="". UserBackend::getLogoutUrl() returns '', since #1235 (5581a24f1, « fix(logout): Ensure we handle logout button correctly »):

if ($slo === '' && !$this->appConfig->getAppValueBool('general-nextcloud_login_form')) {
    return '';
}

OC_User::getLogoutUrl() returns the value of the first active IApacheBackend as-is, so the link is empty and users cannot log out. The assumption « /login redirects straight back into SAML, so a local logout would be pointless » holds for SAML. It does not hold for the environment-variable mode, where the identity layer is an external proxy that has its own logout and may require re-authentication.

Suggestion
  • In environment-variable mode, keep returning core.login.logout. Or restrict the early return to type === 'saml'.
  • Alternatively, implement the long-standing #114 (« allow to set an optional logout url when using the environment variable authentication »): a configurable logout URL for this mode.
Workaround

A local patch removing the early return. It restores the behaviour of 8.4.x and earlier.

Related: #1235, #114, #642.

Ngôn ngữ chính
PHP
Star
106
Fork
84
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
14

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nextcloud/user_saml

Tất cả issue của nextcloud/user_saml

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.