Skip to content

feat: use androidx.browser for AuthenticatorActivity#16766

Open
mykh-hailo wants to merge 1 commit intonextcloud:masterfrom
mykh-hailo:feat/authenticator-browser
Open

feat: use androidx.browser for AuthenticatorActivity#16766
mykh-hailo wants to merge 1 commit intonextcloud:masterfrom
mykh-hailo:feat/authenticator-browser

Conversation

@mykh-hailo
Copy link
Copy Markdown
Contributor

@mykh-hailo mykh-hailo commented Mar 28, 2026

Summary

Use Chrome Custom Tabs (CustomTabsIntent) for login flow v2 instead of opening the default browser with ACTION_VIEW and FLAG_ACTIVITY_NEW_TASK. Users stay in the Nextcloud app task while authentication still runs in their default browser engine, and closing the tab returns them to the in-progress login screen without manually switching apps.

Closes: #15984

Changes

  • AuthenticatorActivity: Open the v2 login URL via CustomTabsIntent (toolbar tinted with R.color.primary, system color scheme, title shown, share disabled for a cleaner UI). Fallback to ACTION_VIEW without FLAG_ACTIVITY_NEW_TASK if Custom Tabs cannot be used.
  • Dependencies: Add androidx.browser:browser (version catalog + app module).
  • Manifest: Declare a intent for CustomTabsService so a Custom Tabs provider can be resolved on API 30+.

@alperozturk96 alperozturk96 force-pushed the feat/authenticator-browser branch from 2eac820 to c965a88 Compare March 30, 2026 07:42
@mykh-hailo
Copy link
Copy Markdown
Contributor Author

@alperozturk96 I'd appreciate it if you provide me any feedback on this PR.

Signed-off-by: mykh-hailo <kristianderonta0205@gmail.com>
@alperozturk96 alperozturk96 force-pushed the feat/authenticator-browser branch from c965a88 to 58a12a8 Compare March 31, 2026 06:34
Copy link
Copy Markdown
Collaborator

@alperozturk96 alperozturk96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello

Thank you for the PR. This is definitely an improvement.

When I checked the API, I noticed a better alternative: AuthTabIntent.

Can we use this?

Additionally, I noticed that the user still needs to open the app switcher and go back to the app. I couldn’t find a way to eliminate this.

Also, please be aware that it must behave exactly the same as master for the following scenarios:

  • User enters the URL to log in for the first time
  • User enters the same URL to log in again with different user name
  • User enters a different URL to log in for the first time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use androidx.browser for AuthenticatorActivity

2 participants