Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Gets ERR_NAME_NOT_RESOLVED on oauth callback

$
0
0

My Ionic Info
@capacitor/cli”: “^3.4.3”,

I’m implementing oauth2 on an Ionic React app for Android but when receive the callback with the code and status, the webview shows an ERR_NAME_NOT_RESOLVED.

In the capacitor config.json I forze https for the app:

"server": {
    "iosScheme": "ionic",
    "androidScheme": "https",
    "hostname": "com.gronze.maps",
....

In the android manifest I use an intent filter

<intent-filter>
                <data android:scheme="@string/custom_url_scheme"/>
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>
            </intent-filter>

and in the strings.xml I use the custom_url_scheme
<string name="custom_url_scheme">com.gronze.maps</string>

When calls to the mydomain/oauth2/authorize with the oauth params, my server sends the callback
https://com.gronze.maps/?code=&state=m8882
but the app shows a blanck page with the ERR_NAME_NOT_RESOLVED.

Captura de Pantalla 2022-08-23 a las 16.25.27

But if I reload the webview with this url, the app works fine again.
What is happening? it fails on callback but works if reload

If instead of com.gronze.maps I use localhost, and the callback received is https://localhost/?code=&state=m8882 the page shows an ERR_CON_REFUSED and if I try to reload it works again

Thanks!
Jorge

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>