-
Notifications
You must be signed in to change notification settings - Fork 904
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
Cant make firebase auth works on cordova. Error: 403 disallowed_useragent #507
Comments
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information. |
What I have missed. I tried to give all information I could. May you tell me what I am missing 👍 |
This OAuth redirect must be getting processed in a webview. It should normally go through a chrome custom tab. You must not have installed the correct plugin: cordova-plugin-browsertab We have noticed that the latest version of ionic in iOS renders the page in a http://localhost locally hosted page which then triggers the regular web flow causing this to break. This is a known issue. Are you noticing the same pattern in your case? |
I am having a similar issue on iOS. I have followed all the instructions in the documentation and once I grant access (using Google sign-in) in Safari, it redirects to the URL http://localhost:8080/var/containers/Bundle/Application/APP_UUID/MyApp.app/www/index.html, which doesn't load anything. I managed to solve the issue by adding the following line to my
|
As commented by @bojeil-google this is a known issue for ionic wkwebview which is using http instead of file protocol. I tried to work around by changing the 'file' into 'http' in this file "packages/auth/src/utils.js" > function "isAndroidOrIosFileEnvironment" and it's working but not sure if it would cause any other issue. |
@bojeil-google Can you indicate the solution of this issue, please? |
I tried to use an other user agent and the page opened but then I need to login into google accounts manually.. any solution for that? |
@superbigsoft / @bojeil-google do you have a link to the known issue? Also did you get it working inside wkwebview by only changing those lines? I changed Digging further, without wkwebview cordova makes a call to a URL that is formatted like this: Whereas with @superbigsoft's hack of removing 'file' and replacing 'http' (with wkwebview: I'm using capacitor with cordova plugins) I get this URL: Which leads me to believe that more changes need to be made for firebase to detect if it is in a hybrid/native environment. Right now firebase is trying to detect its environment. It sure would be nice if I could just tell firebase what environment it's in. |
@corysmc I have the same issue using firebase and angular 7. |
@nadhir-falta we ended up using firebase native authentication for ios and android, and used capacitor to make the call from the webview. |
@corysmc - Do you want to share your solution with us? |
It's a pretty big hack @scriptPilot. |
@corysmc - Means your own buttons with native language or own auth flow in web view? |
our html buttons call a capacitor plugin that uses the native sdks to authenticate |
Please have a look at this StackOverflow answer: It could solve this issue (or work around it). |
Closing this, since there's been no activity since the StackOverflow answer was submitted. Please feel free to re-open if this is still an issue. |
Environment
Problem
Firebase auth on cordova does not works event if with all setup asked on firebases documention.
I have deeply follow the instructions to implement Auth on cordova apps as this tutorial: https://firebase.google.com/docs/auth/web/cordova?handle_the_sign-in_flow_with_the_firebase_sdk
Steps to reproduce:
Relevant Code:
Screenshot
The text was updated successfully, but these errors were encountered: