RocketChat / RocketChat/Rocket.Chat

CAS Authentication not working if deployed in server subfolder

Open
#8,837 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description:

I've deployed Rocket Chat behind a Apache reverse proxy in a server subfolder, as per the instructions given in the docs.

The "out of the box" deployment seems to work as a charm, I can use the application with no problems whatsoever.

But I need SSO access via CAS and so I configured it in the admin menu. Sadly, it doesn't work, Rocket Chat does display the popup with the CAS login screen but, after logging in with CAS, the popup just shows a blank page and the sign on in Rocket chat never happens.

Server Setup Information:
  • Version of Rocket.Chat Server: 0.59.3
  • Operating System: Ubuntu 16.04
  • Deployment Method(snap/docker/tar/etc): tar
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Disabled
  • Node Version: 4.8.4 - x64
Steps to Reproduce:
  1. Deploy Rocket Chat behind a reverse proxy in a subfolder, as per the instructions given in the docs
  2. Configure chat login parameters in the admin menu.
  3. Attempt to login via CAS, enter credentials in CAS login popup.
Expected behavior:

The user should login to Rocket Chat, popup windows should disappear and the user should end up in Rocket chat home screen.

Actual behavior:

The CAS login popup never disappears and shows a blank screen, the login to Rocket chat never happens. It is still possible to login with your "normal" (non CAS) users via the standard login procedure, though.

The key to the error might be that, for some reason, the server subfolder in the ticket request for CAS is printed twice. Notice the address bar in the screenshot of the login popup, it shows "mitomedchat" twice (the deployment URL is https://mydomain.com/mitomedchat)

imagen

While this issue is solved, I worked around the problem by deploying Rocket Chat in the root (/) of a subdomain, and login via CAS worked without any issues.

Cheers.

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 with the documented Apache reverse-proxy deployment in a server subfolder and reproduce the CAS login flow using the reported Rocket.Chat 0.59.3 setup. Compare the generated CAS ticket URL and callback path with a root deployment; done means CAS login completes without duplicating the subfolder or leaving a blank popup.

Written by the indexing model from the issue text.

Assessment

Tech stack
apache
Domain
authentication, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.