RocketChat / RocketChat/Rocket.Chat

Custom Oauth seems to not respect token lifetime

Open
#19,745 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

RocketChat server seems to be handling the session lifetime on it's own, as opposed to respecting the accessToken lifetime, using the refreshToken to update the accessToken, and forcing the user to re-login in the case that they have both expired.

Steps to reproduce:
  1. Configure login via custom Oauth
  2. In Oauth (in our case keyclaok) set i.e. accessToken lifetime to 8h and refreshToken lifetime to 5 min
  3. After both token expire user is still logged
Expected behavior:
  • server should respect the accessToken lifetime (in our case 2 hours).
  • when a client opens a new session, if the accessToken has expired, the RC server should request a new access token from the Oauth provider, using the refreshToken The RC server would then receive both a new accessToken and refreshToken in the response
Actual behavior:

User is logged after tokens expired

Server Setup Information:
  • Version of Rocket.Chat Server: 3.6.3
  • Operating System: Centos7
  • Deployment Method: docker-compose
  • Number of Running Instances: 30
  • DB Replicaset Oplog: YES
  • NodeJS Version: v12.16.1
  • MongoDB Version: 4.0.16
Client Setup Information
  • Desktop App or Browser Version: both
  • Operating System: Windows 10
Additional context
Relevant logs:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the custom OAuth flow with the stated Keycloak token lifetimes and checking how Rocket.Chat handles sessions after accessToken and refreshToken expiry. Trace the server-side session and token handling, then verify that expired tokens trigger refresh or re-login as described.

Written by the indexing model from the issue text.

Assessment

Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.