-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oAuth not properly working on Android with firefox as default browser #27
Comments
I wonder if setting the |
Good Idea, I'll test it tomorrow and let you know 👍 |
We already used Also I noticed that while the login now works perfectly fine and we only have one Cordova Application, the firefox custom tabs now somehow seem to continue to live as applications in the background until manually closed after the return (Here I logged in and out multiple times, for each time such a "background" firefox instance stays open: Going into one and logging in again redirects again to the app and logs me in. Still better than before but not yet perfect :) I would speculate that Firefox somehow always creates a new instance for the custom Tab and if the Cordova application only allows a single instance this gets somehow detached and lives on on its own without properly closing (in contrast to Chrome which wasn't affected at all from the change and works just fine). But no idea 🤷 I'm not sure if it makes sense to somehow set this via the plugin (if possible), there might be cases where this is not wanted. **edit: ** Correction: More browsers seem to stay open in the background after login, including chrome. |
Just tested a bit further: Setting I stumbled over this flag in the google example for oAuth with custom tabs (The example this plugin is based on for Android is marked as deprecated and links to the repo where I found this example). So I guess this could be an approach for a plugin based fix, but one would probably need to understand more deeply what exactly happens when setting this flag before, I just quickly tested it once I saw it in the google example. Just noting it here for reference, for now we can follow the |
Ok, I think I figured out a working solution 😅
Using |
So the Cordova default is |
Ah sorry I guess my responses got a bit confusing as I just added my new discoveries as new comments 😅 In the end we only needed With In the Apps Cordova <preference name="AndroidLaunchMode" value="singleTask"/> |
When using Firefox as default browser on Android (instead of Chrome), the login via the custom tab works fine, but the redirect somehow seems to trigger Cordova to create a new Application/webview instead of being sent to/caught by the webview that triggered the oAuth login.
The redirect then seems to get lost and the user just ends up in the freshly created Cordova app again with the login seemingly not successful.
I reproduced the issue with the example plugin from the open pull request #24
Steps to reproduce:
Sign in with oAuth
LOGGED IN
and allows to "logout".Sign in with oAuth
The inspect tool also shows that for each login attempt with firefox as default browser a new webview is created:
With Chrome we always have the same webview, no matter how often we log in/out.
Honestly, from what I tested so far, I'm not sure what the exact issue here is and would guess that it's not really the fault of this plugin but an issue with the custom tab implementation of firefox. The login works, but the redirect from the custom tab creates the new webview instead of being handled by the one starting the oAuth process.
Any ideas what could be done to fix this behavior?
The text was updated successfully, but these errors were encountered: