Custom OAuth callback times out when Merge roles from SSO is enabled

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

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

@Pantkartik đang làm issue này rồi.

Từ ngày 28/11/2026.

  • #44006 của @Pantkartik — đang mở
  • #44013 của @shashankk-singh — đang mở

Đá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
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
authentication, backend

Hướng nghiên cứu

Bắt đầu tại oauth.ts:73, nơi settings.rolesToSync.split(',') được gọi. Cập nhật logic hợp nhất vai trò để xử lý rolesToSync không xác định, sau đó xác minh rằng đăng nhập Custom OAuth với Authentik thành công thay vì gây ra TypeError không được xử lý và HTTP 504.

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

Mô tả

type: bug
Description:

Custom OAuth authentication fails when Merge roles from SSO is enabled and rolesToSync is undefined.

Steps to reproduce:
  1. Configure Custom OAuth using Authentik.
  2. Enable Merge roles from SSO with rolesToSync undefined.
  3. Attempt authentication using Authentik.
Expected behavior:

Successful authentication and login to Rocket.Chat.

Actual behavior:

Authentik authentication, token exchange and user information retrieval succeed. Rocket.Chat throws an unhandled TypeError, resulting in a 504 Gateway Timeout.

Server Setup Information:
  • Version of Rocket.Chat Server: 9.0.0
  • License Type: Starter
  • Number of Users: 10
  • Operating System: Debian
  • Deployment Method: Docker Compose
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Replica set configured
  • NodeJS Version: Not recorded
  • MongoDB Version: Not recorded
Client Setup Information
  • Desktop App or Browser Version: Chrome
  • Operating System: Linux
Additional context

Authentication was also failing under Rocket.Chat 8.8, prompting the upgrade to 9.0.0. Whether the underlying defect was identical remains unverified.

The affected code assumes rolesToSync is a string:

settings.rolesToSync.split(',').map((role) => role.trim())

The stored configuration contains mergeRoles: true and rolesToSync: undefined.

Verified workaround: Disable Merge roles from SSO, save and refresh OAuth services. Authentication then succeeds.

Relevant logs:

Server exception, reproduced three times:

TypeError: Cannot read properties of undefined (reading 'split')
    at oauth.ts:73:26

Associated with an unhandled promise rejection.

Reverse proxy: HTTP 504 at /_oauth/authentik.

Authentik token exchange and user information endpoints both returned HTTP 200.

Ngôn ngữ chính
TypeScript
Star
46.6k
Fork
14.2k
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
302

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 RocketChat/Rocket.Chat

Tất cả issue của RocketChat/Rocket.Chat

Issue tương tự

Thêm issue về TypeScript

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.