Pregunta

I'm struggling to set a correct returnTo path for 3rd party authentication (i.e. GitHub) in my Cordova/PhoneGap app on an Android 4.3 device. The command to do this in GoAngular is $goConnectionProvider.$loginUrl(providerName, returnTo).

In my dev environment I pass window.location.href as my returnTo parameter and of course this works fine as the app's location is reported as http://localhost:[port]/[path]. Note, I had to whitelist localhost in my GoInstant dashboard.

It's worth noting that 3rd party auth also works fine when running through the PhoneGap Developer App on an Android device (since the PhoneGap app basically serves my app over a local IP address, which I also whitelisted).

On Android, the path reported to window.location.href is file:///android_asset/www/index.html#/app/. Therefore, this is the path I supplied to $goConnectionProvider.$loginUrl. Unfortunately $goConnection throws an error as this is not an HTTP or HTTPS url.

What should my returnTo path be? Any suggestions?

¿Fue útil?

Solución

Unfortunately the GoInstant Auth API doesn't currently support Cordova/PhoneGap. The browser views the redirect request as cross-protocol and prevents it.

We've added Cordova/PhoneGap support to the roadmap and I'll update this answer when it becomes available!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top