GIDSignInCompletion block not called when ASWebAuthenticationSession is interrupted by device locking
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- ios, objective-c
- Ambito
- authentication, mobile
Direzione di ricerca
Inizia tracciando il ciclo di vita di ASWebAuthenticationSession nell’SDK e il modo in cui vengono gestite le transizioni dell’app tra background e foreground. Confronta il comportamento in caso di interruzione descritto qui con AppAuth-iOS issue 468. Il lavoro è completato quando una sessione interrotta invoca GIDSignInCompletion con una cancellazione o un altro errore rilevabile, così che l’app host possa reimpostare la propria UI.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Objective-C
- Stelle
- 751
- Fork
- 282
- Merge medio
- 2g 15h
- PR unite (30g)
- 9
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google/GoogleSignIn-iOS
-
enhancement triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google/GoogleSignIn-iOS#621 ·
-
enhancement triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
google/GoogleSignIn-iOS#620 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
google/GoogleSignIn-iOS#440 · 4 commenti · 2 reazioni ·
-
enhancement triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
google/GoogleSignIn-iOS#611 ·
-
Remove Cocoapods Support Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
google/GoogleSignIn-iOS#607 ·
Tutte le issue di google/GoogleSignIn-iOS
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
macOS下查找brew::ncurse失败 Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
noah-nuebling/mac-mouse-fix#2054 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
obsproject/obs-studio#13918 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
HigherOrderCO/Bend#842 · 2 commenti ·