bug: Custom OAuth login succeeds server-side every time but app loops back to login screen (iOS, 4.75.0)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- ios, react-native, typescript
- Lĩnh vực
- authentication, mobile
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi luồng Custom OAuth trên mobile qua ASWebAuthenticationSession/Chrome Custom Tabs và login saga, rồi so sánh với bản sửa lỗi hủy trong #7340 và phần làm lại trong #6987/#7419. Sử dụng POST /api/v1/login thành công đã được báo cáo làm ranh giới để kiểm tra; hoàn thành có nghĩa là một phản hồi OAuth thành công đưa ứng dụng vượt qua màn hình đăng nhập mà không khởi động lại handshake.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
Logging in via a Custom OAuth provider (self-hosted Keycloak, standard OIDC) on the mobile app succeeds completely on the server side every single time, but the app never leaves the login screen — it silently re-initiates the entire OAuth handshake every ~15-20 seconds in an infinite loop. Web login against the exact same Custom OAuth provider/server works correctly on the first try.
Environment
- App version: 4.75.0
- Platform: iOS (native app, "RC Mobile")
- Server version: Rocket.Chat 8.6.1
- Auth method: Custom OAuth pointed at a self-hosted Keycloak instance (standard OIDC —
/auth,/token,/userinfoendpoints) - Login Style: Tried both
PopupandRedirectin Admin → OAuth → (custom provider) — no change in mobile behavior either way - 2FA: Disabled account-wide for testing — no change in behavior
Steps to reproduce
- Configure a Custom OAuth provider against a standard OIDC/Keycloak server.
- Open the RC Mobile app (iOS), tap the custom OAuth login button.
- Authenticate against the identity provider (Keycloak login page).
- Observe: the auth popup/browser session closes with no visible error, but the app stays on the login screen.
- Wait ~15-20 seconds without doing anything — a brand new OAuth handshake (fresh authorization code) starts automatically, completes silently (no re-prompt, since the IdP still has an active session), and the app still doesn't log in. This repeats indefinitely.
What I verified server-side (ruling out server/IdP/proxy causes)
Traced the full request chain end-to-end across three independent login attempts, all with identical results:
GET https://sso.example.com/realms/<realm>/protocol/openid-connect/auth?client_id=<id>&redirect_uri=https%3A%2F%2Fchat.example.com%2F_oauth%2F<provider>&response_type=code&state=<state>&scope=openid
→ Keycloak returns302immediately (existing IdP session, no interactive prompt needed after the first attempt).- RocketChat's server exchanges the code:
POST https://sso.example.com/realms/<realm>/protocol/openid-connect/token→ succeeds. GET https://sso.example.com/realms/<realm>/protocol/openid-connect/userinfo→ succeeds, returns the full identity (email, name, sub, etc.).- RocketChat's
CustomOAuthlogs"Identity response"with the correct user identity. - RocketChat's login-validation callbacks fire cleanly, in order, with no exception:
afterValidateNewOAuthUser→onValidateLogin→afterValidateLogin. - The app's own REST call —
POST /api/v1/loginwithuserAgent: RC Mobile; ios ...and the OAuth credential in the body — returns HTTP 200.
This full sequence (steps 1-6) completed successfully three times in a row across separate login attempts, each with its own fresh authorization code, each getting a clean 200 on /api/v1/login. There is no error, rejection, or exception anywhere in the server-side chain on any attempt. Despite that, the app immediately restarts the same sequence again ~15-20 seconds later, and never transitions out of the login screen.
Decoded state parameter from the request (values redacted, structure intact):
{
"loginStyle": "redirect",
"credentialToken": "<redacted>",
"isCordova": true,
"redirectUrl": "rocketchat://auth"
}
Note loginStyle is redirect regardless of what the server's Admin → OAuth → Login Style setting is configured to (tried both Popup and Redirect server-side with no change in this value or in mobile behavior) — the mobile app appears to always request redirect style for Custom OAuth, independent of that server setting.
Possibly related
This looks like it could be the same underlying class of bug as #7333 (fixed by #7340: "don't cancel login saga on 2s timeout") — a race/cancellation between successful OAuth completion and the UI state advancing past the login screen — but resurfacing in the newer native-browser-session Custom OAuth flow introduced by #6987 / #7419 (which moved Custom OAuth to ASWebAuthenticationSession/Chrome Custom Tabs and explicitly forced redirect-style login, "activating existing (previously dormant) saga logic"). #7340's fix predates that rework, so it may not cover this newer code path.
Expected behavior
After a successful OAuth completion (confirmed server-side), the app should recognize the returned session and transition to the logged-in state, rather than silently discarding it and re-initiating the OAuth flow.
Additional notes
- Uninstalling and reinstalling the app does not change the behavior.
- Force-quitting and reopening the app does not change the behavior.
- Happy to provide more detail (redacted server logs, HAR-equivalent request traces) on request — omitted here since they contain internal hostnames/identifiers.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.4k
- Fork
- 1.5k
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 29
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của RocketChat/Rocket.Chat.ReactNative
-
[IMPROVEMENT] Remove redundant `await` on synchronous `userPreferences.getBool` in `getUsersPresence`Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởtype: feature
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
RocketChat/Rocket.Chat.ReactNative#7737 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
UIKit modal: a viewSubmit response with no `type` field fails to close the modal on mobile (regression from #7057)Có thể đã có người làm @erikurt9 đã nhận 106 ngày trước. Đang mởtype: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
RocketChat/Rocket.Chat.ReactNative#7503 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
type: bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
RocketChat/Rocket.Chat.ReactNative#7437 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
✅ tests 👷 ci type: feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
RocketChat/Rocket.Chat.ReactNative#7247 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: goRoom navigates to broken RoomView after failed DM creation from searchCó thể đã có người làm @deepak0x đã nhận 216 ngày trước. Đang mởtype: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
RocketChat/Rocket.Chat.ReactNative#7098 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của RocketChat/Rocket.Chat.ReactNative
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
langchain-ai/langchainjs#12239 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Board view: the Monitoring column is always empty because compact issue rows drop displayStatusĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
paperclipai/paperclip#21837 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
code-yeongyu/senpi#6813 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 93/100
lingdojo/kana-dojo#34169 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100