RocketChat / RocketChat/Rocket.Chat.ReactNative
bug: unable to login if authentication is delegated to another CAS server
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 1.5k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 90
Description
Describe the Bug
In our authentication system, we have 2 CAS servers (one for first-factor authentication, the other for MFA).
When the first factor is validated, CAS redirects to the CAS server dedicated to the second factor (with the ticket of the first CAS server in the URL), the Rocket.Chat application considers the authentication successful and avoids validating the MFA.
https://github.com/RocketChat/Rocket.Chat.ReactNative/blob/788cb8dffe02ea2e85c4b93e0a90e5f2473c7356/app/views/AuthenticationWebView.tsx#L109
https://github.com/user-attachments/assets/0a366475-b43e-4940-bf6a-b6a4466d114f
Steps to Reproduce
- Select a Rocket.Chat server whose CAS server delegates to another CAS server
- Validate the first authentication
It is not possible to validate the second factor.
Expected Behavior
The Rocket.Chat mobile application should only close the AuthenticationWebView once you've arrived at the requested service.
Actual Behavior
The Rocket.Chat mobile application closes the AuthenticationWebView when a CAS ticket is found in the URL
https://github.com/RocketChat/Rocket.Chat.ReactNative/blob/788cb8dffe02ea2e85c4b93e0a90e5f2473c7356/app/views/AuthenticationWebView.tsx#L109
Rocket.Chat Server Version
7.1.0
Rocket.Chat App Version
4.67.0.107747
Device Name
Apple iPad 9
OS Version
iPadOS 18.7.2
Additional Context
No response
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 app/views/AuthenticationWebView.tsx at the linked line and trace how the WebView handles a CAS ticket in the URL. Reproduce the delegated two-CAS flow described in the issue, then verify that the WebView remains open through second-factor authentication and closes only after reaching the requested service.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- authentication, mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100