mardi 7 février 2017

Cordova app not hitting API on Android

I've looked through a lot of similar issues, but none have seemed to work for me. Our app makes 2 API requests - the first to fetch an OAuth code to our API (works fine) and the other posts that code to the Rails API (which is failing).

I am posting to http://localhost:3000/api/v1/users/auth/openid_connect/callback

But getting net::ERR_CONNECTION_REFUSED. However, this works fine when running on iOS.

My config currently has:

<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-navigation href="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />

I've tried adding <allow-intent href="http://localhost:3000/api/v1/*" /> and <allow-intent href="http://ift.tt/2knjgZK" /> and even the full openid_connect/callback URL but none seem to work.

In my index.html, I have

<meta http-equiv="Content-Security-Policy" content="default-src * 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; connect-src * 'unsafe-inline'">

Does the issue lie with how I am handling allow-intent in the config or do I have the Content-Security-Policy wrong?




Aucun commentaire:

Enregistrer un commentaire