feat: use androidx.browser for AuthenticatorActivity#16766
feat: use androidx.browser for AuthenticatorActivity#16766mykh-hailo wants to merge 2 commits intonextcloud:masterfrom
Conversation
2eac820 to
c965a88
Compare
|
@alperozturk96 I'd appreciate it if you provide me any feedback on this PR. |
c965a88 to
58a12a8
Compare
alperozturk96
left a comment
There was a problem hiding this comment.
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
|
@alperozturk96 I read through the code and looks like it cannot perfectly solved only on android. |
@alperozturk96 I'd appreciate it if you share any opinion about this. |
For now, we can proceed with using Please let me know if this works for you. Thank you. |
Signed-off-by: mykh-hailo <kristianderonta0205@gmail.com>
11e56f1 to
176198e
Compare
|
@alperozturk96 I replaced the CustomTabsIntent with AuthTabIntent. |
alperozturk96
left a comment
There was a problem hiding this comment.
Hey
Thanks for the update.
app/src/main/AndroidManifest.xml
Outdated
| <package android:name="org.fairscan.app" /> | ||
|
|
||
| <intent> | ||
| <action android:name="android.support.customtabs.action.CustomTabsService" /> |
There was a problem hiding this comment.
Why we need this? I removed this and still worked.
There was a problem hiding this comment.
I fixed it. Can you check again please?
|
@tobiasKaminsky I tested this PR and it seems to behave the same as the master branch. When a user enters the URL to log in for the first time, they are prompted to enter a username and password. However, if the user visits the same URL again to log in with a different account, the previously logged-in account is shown, and only the “Grant Access” option is available. To log in with a different account, the user must clear the browser’s history (or session data). After doing so, they can log in with another account. This behavior is the same as in the master branch. |
Signed-off-by: mykh-hailo <kristianderonta0205@gmail.com>
176198e to
dd5451a
Compare
Summary
Use Chrome Custom Tabs (
CustomTabsIntent) for login flow v2 instead of opening the default browser withACTION_VIEWandFLAG_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 viaCustomTabsIntent(toolbar tinted withR.color.primary, system color scheme, title shown, share disabled for a cleaner UI). Fallback toACTION_VIEWwithoutFLAG_ACTIVITY_NEW_TASKif Custom Tabs cannot be used.androidx.browser:browser(version catalog + app module).CustomTabsServiceso a Custom Tabs provider can be resolved on API 30+.