AppAuth-Android icon indicating copy to clipboard operation
AppAuth-Android copied to clipboard

Chrome Custom Tab will not be closed, same when using Chrome Browser

Open mightymop opened this issue 2 years ago • 2 comments

Checklist:

  • [x] I am using the latest release
  • [x] I searched for existing GitHub issues
  • [x] I read the documentation
  • [x] I verified the client configuration matches the information in the identity provider (or I am using dynamic client registration)
  • [x] I am either using a custom URI scheme or https with App Links for client redirect.
  • [ ] I can reproduce the issue in the demo app (optional)

Configuration

  • Version: 0.11.1
  • Integration: native(Java) conjunction with cordova (as a plugin)
  • Identity provider: Microsoft ADFS (Version 4, Win Server 2019 > OpenID Connect)

Issue Description

I have the following issue: The Chrome Custom Tab persists as a task after the login flow. Using 'adb shell dumpsys activities...' I was able to see that the Custom Tab runs in its own task. However, the AuthorizationManagementActivity was properly terminated and returned to the calling activity after the login flow. The issue does not occur during logout.

Here's what I've developed: I have a Cordova plugin that connects Android Authenticator with App-Auth Android. For this purpose, I have two activities (LoginOIDCActivity and LogoutOIDCActivity). I can invoke both using Intent filters. Both start their respective flows and return to the calling activity upon completion. I specified AuthorizationManagementActivity with LaunchMode = singleInstance because returning to the app did not work with singleTask. With singleTop, the Chrome task was closed, but the return to the app still failed.

Login Flow: Cordova MainActivity > Plugin calls LoginOIDCActivity > launches AuthorizationRequestIntent (AuthorizationManagementActivity) via 'registerForActivityResult(new ActivityResultContracts.StartActivityForResult()....)' / 'launch...' > Chrome Custom Tab > RedirectUriReceiverActivity > AuthorizationManagementActivity > LoginOIDCActivity (result) > Cordova plugin > back to webview

That's working, but the Chrome Custom Tab still remains in the task manager. For a new login, a new Custom Tab is added to the task manager. As I mentioned, the logout flow works fine with post_logout_url...

Similar issue when using Chrome Browser for login. On every login a new tab is added to chrome.

Using: Android 12

mightymop avatar Oct 17 '23 00:10 mightymop

Have the same problem. Does anyone know how to fix this?

Olexandr1904 avatar Feb 16 '24 12:02 Olexandr1904

Have the same problem. Does anyone know how to fix this?

yawarkhan224 avatar Jun 13 '24 10:06 yawarkhan224