Fix Chrome Custom Tab auto-dismissal after verification on Android#14
Merged
Conversation
Force custom window close
Dismiss Chrome Custom Tab automatically after verification completes
gclaro-idme
approved these changes
Apr 23, 2026
antspriggs
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
After verification completes, the Chrome Custom Tab was not dismissing automatically —
the user had to manually tap Done/Dismiss. iOS handles this natively via
ASWebAuthenticationSession. Android requires the SDK to manage it explicitly.
Root Cause
IDmeRedirectActivity was calling finish() after receiving the redirect, which popped
it off the stack but revealed the Custom Tab sitting behind it. Nothing was bringing
the calling app back to the foreground.
Fix
flow starts, cleared on completion
back to the calling Activity with FLAG_ACTIVITY_CLEAR_TOP before calling finish(),
which removes the Custom Tab from the back stack and returns the user to the app
Files changed
IDmeAuthManager.kt— added WeakReference to calling ActivityIDmeRedirectActivity.kt— added foreground restore on redirect