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

Abierto Apto para principiantes
#44,005 2 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@Pantkartik ya está trabajando en esto.

Desde el 28/11/2026.

  • #44006 de @Pantkartik — abierto
  • #44013 de @shashankk-singh — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
82/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Comienza en oauth.ts:73, donde se llama a settings.rolesToSync.split(','). Actualiza la lógica de combinación de roles para que gestione un rolesToSync undefined y, a continuación, verifica que el inicio de sesión Custom OAuth con Authentik se complete correctamente en lugar de producir un TypeError no controlado y HTTP 504.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
46.6k
Forks
14.2k
Merge medio
2 d 21 h
PR fusionados (30 d)
302

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de RocketChat/Rocket.Chat

Todos los issues de RocketChat/Rocket.Chat

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.