GIDSignInCompletion block not called when ASWebAuthenticationSession is interrupted by device locking
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- ios, objective-c
- 领域
- authentication, mobile
调研方向
首先跟踪 SDK 的 ASWebAuthenticationSession 生命周期,以及应用在后台和前台之间切换时的处理方式。将此处描述的中断行为与 AppAuth-iOS issue 468 进行比较。当中断的会话通过取消或其他可检测的错误调用 GIDSignInCompletion,使宿主应用能够重置其 UI 时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
When using Google Sign-In SDK on iOS, if the user locks their device or the app transitions to background during the authentication flow (while ASWebAuthenticationSession is active), the GIDSignInCompletion block is never called. This leaves the app in an indefinite loading/blocked state with no way to detect that the session was interrupted or cancelled by the OS.
To Reproduce
- Initiate Google Sign-In flow in an iOS app
- Wait for the
ASWebAuthenticationSessionsystem prompt to appear - Lock the device before completing authentication
- Unlock the device and return to the app
- Observe that the
GIDSignInCompletionblock is never called (no success, no error, no cancellation callback) and theASWebAuthenticationSessionalert is dismissed.
Expected behavior
The GIDSignInCompletion block should be invoked with either:
- A cancellation result/error indicating the session was interrupted, OR
- A property that allows detection of this interrupted state
This would allow the host app to reset its UI state (e.g., hide loading indicators, re-enable the sign-in button).
Screenshots
N/A.
Environment
- Device: iPhone (various models)
- OS: iOS (tested on iOS26, iOS18)
- SDK: Google Sign-In SDK for iOS
Additional context
This issue stems from how iOS handles ASWebAuthenticationSession interruptions. When the device is locked or the app goes to background, iOS may dismiss the authentication prompt without reliably delivering a cancellation callback to the SDK.
A similar issue has been reported by multiple users in the AppAuth-iOS repository: https://github.com/openid/AppAuth-iOS/issues/468. A fix for the SDK is observing the app's background/foreground state transitions and invoking the completion block if a previously active session was found. We recommend Google Sign-In SDK implement a similar mechanism to detect interrupted sessions and return an appropriate callback to the host application.
- 主要语言
- Objective-C
- 星标
- 751
- 派生
- 282
- 平均合并
- 4 天 20 小时
- 30 天内合并 PR
- 11
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/GoogleSignIn-iOS 的其他 Issue
-
enhancement triage
难度 2/5 1-3 小时 新手友好度 72/100
google/GoogleSignIn-iOS#621 ·
-
enhancement triage
难度 2/5 1-3 小时 新手友好度 76/100
google/GoogleSignIn-iOS#620 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
google/GoogleSignIn-iOS#440 · 4 条评论 · 2 个 reaction ·
-
enhancement triage
难度 4/5 3-5 天 新手友好度 48/100
google/GoogleSignIn-iOS#611 ·
-
难度 4/5 3-5 天 新手友好度 45/100
google/GoogleSignIn-iOS#607 ·
查看 google/GoogleSignIn-iOS 的全部 Issue
相似的 Issue
-
Icons Metro Public Transport
难度 1/5 1 小时以内 新手友好度 75/100
organicmaps/organicmaps#13617 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
objective-see/LuLu#925 ·
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 72/100
noah-nuebling/mac-mouse-fix#2054 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
obsproject/obs-studio#13918 ·