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

オープン 初心者向け
#44,005 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Pantkartik がすでに取り組んでいます。

2026年11月28日 から。

  • #44006 @Pantkartik による — オープン
  • #44013 @shashankk-singh による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

oauth.ts:73 から開始します。そこでは settings.rolesToSync.split(',') が呼び出されています。ロールの結合ロジックを更新して undefined の rolesToSync を処理できるようにし、未処理の TypeError や HTTP 504 が発生しない.Custom OAuth による Authentik へのログインが成功することを確認してください。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
46.6k
フォーク
14.2k
平均マージ
2日 21時間
マージ済み PR(30日)
302

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

RocketChat/Rocket.Chat のほかの issue

RocketChat/Rocket.Chat の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。