RocketChat / RocketChat/Rocket.Chat
CAS Authentication not working if deployed in server subfolder
Nobody has claimed this yet.
- 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:
- Deploy Rocket Chat behind a reverse proxy in a subfolder, as per the instructions given in the docs
- Configure chat login parameters in the admin menu.
- 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)

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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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