apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 987 forks source link

[Error] Cross-origin redirection to http://developers.google.com/ denied by Cross-Origin Resource Sharing policy: Origin ionic://localhost is not allowed by Access-Control-Allow-Origin. Status code: 301 #1318

Closed balaji-nilaapps closed 1 year ago

balaji-nilaapps commented 1 year ago

Bug Report

Problem

Cross-origin redirection to http://developers.google.com/ denied by Cross-Origin Resource Sharing policy: Origin ionic://localhost is not allowed by Access-Control-Allow-Origin.

What is expected to happen?

Show popup for select account for sign-in with google or facebook or apple using firebase

What does actually happen?

Show Cross-origin redirection to http://developers.google.com/ denied by Cross-Origin Resource Sharing policy: Origin ionic://localhost is not allowed by Access-Control-Allow-Origin.

Information

Command or Code

Environment, Platform, Device

Version information

@angular/*:^15.2.5 @ionic/angular:^6.7.0 cordova-ios:6.3.0 firebase:^9.20.0

Checklist

dpogue commented 1 year ago

FYI if you're trying to do OAuth for login, Google won't let you do that in the Cordova WebView anymore because of security concerns.

You might need to look at options for compliant OAuth support, such as what Firebase recommends or cordova-plugin-oauth.

breautek commented 1 year ago

firebase:^9.20.0

This is the Web JS API, which is explicitly mentioned to be not supported in Cordova Environments.

See their Athentication module note:

Note: All Authentication features, except phone authentication and popup/redirect OAuth operations, are supported.

Therefore popup authentication is only supported in a real browser and not inside an embedded webview.

dpogue's comment has links for the why Google/Firebase does not support Cordova/embedded webviews in this manner as well as links for what to do instead.

Closing as not a bug / won't fix.