[solved]fetch API call timeout error https://graph.facebook.com/v10.0/oauth/access_token

Thanks Shan.
I have tried afresh with hardcoding all the parameters from a test function.
To be double sure, I ran the same test function from both the server side and client side.
Server side - times out almost always.
Client side - works as expected
curl - works as expected
I am absolutely convinced this is a WIX server side network/firewall/whitelisting issue.

The reason I say this is once out of the blue Yesterday I did get a Facebook error on the serverside and all of it was in Mandarin / Taiwanese.

"["Result “,{“error”:{“message”:“無法載入網址: 這個網址的網域未包含在應用程式的網域中。若要載入這個網址,請在應用程式設定的「應用程式網域」欄位中新增應用程式的所有的網域及子網域。”,“type”:“OAuthException”,“code”:191,“fbtrace_id”:“A7MTKxbGU8ET5FaU_bfFMyy”}}]”

I have no option other than hosting this OAuth component elsewhere, sigh.


Here is the code, (note: everything is hardcoded for testing).

let url = “https://graph.facebook.com/v10.0/oauth/access_token?client_id=xxxxxx&client_secret=xxxxxxx&redirect_uri=https://my.domain.xyz/processfbsociallogin&code=AQCCZUNjiZh5hX6F5fruAB8o5IcNON39tVAuOnRV2jAqFxJWtcz1JjrDP90VVu49pBVx-5hTR2RZ3823Eh9Pgd4kROsSXs_QE0KtFG2I_HX76r6Vk-JFq0iFtwlUPs7skRPRi7sSxOOGKPoS00Scc_GPHpq7SN05Bfc39RN1L4vDtYlrkkh8En8tpbjABtEt-l020DEVVj4m_DI49LbHMHUwJzLzuH2vOKVu4KNNX-pwj5mLYabhmoICDwKB_j3zYeO-fMKaXQVrcsFDs2DTVApUmSNvYd_LQ96Zuf6UuwN8gQCi7uhibcs2HdMPmjSdtoVj3ybUs1ZP_31rRoAp_K81&state=gpkszrfnshmvwgxt0va2”

const response = await fetch ( url , { method : “get” });
let result = await response . json ();
console . log ( "Resilt " , result );


Server side output:
“[“Error “,”{"error":{"code":"ETIMEDOUT","connect":true}}”]”
-or-
“[“WebMethod request timed-out after 14 seconds… Did you forget to resolve a promise?”]”


Client side:
“Resilt {“access_token”:“EAANHy9B9hMIBAB3fUcg19yYkAJWRqfBvqgHGOZAtRZC4duiHOajGcMkoZCwWZB8yFNOUUeqDtCcP4nE70Uy3UOrtKc2BQAWZC2cO80aoKH0qUw1d9PoTdRvdc9xzxZAMqOJbYtWPD6GsDn0HZAJegxZBy9KPoIooH8dXVigoxTrrAxIVd2KcbRZBW00AnbOW9Jw5YD6pHwF0yTwZDZD”,“token_type”:“bearer”,“expires_in”:5119595}”


curl output :
curl -X get “https://graph.facebook.com/v10.0/oauth/access_token?client_id=xxxxxx&client_secret=xxxxx&redirect_uri=https://my.domain/processfbsociallogin&code=AQBmEx3gpImkUEvgTGSCKGwIZMgwJoAsHxwK2wmdGgsbieeQTTQAu2jEEKWRFaIrixIQMLc1AzZzL1aq7AFxpMIFUtPCoSMCpFwhW3dDhjIt0RGRYBU2lNJ8yqai3rUJZgE7VgmKZ32L3MVtlx_OhIGJI6nTRBlwszYgGnelNA6NTV6uNL7F1JpVR_CqjjgWKZ8OJwPXHMVoUcZbOhlh7_K4qBp9mVckzr3XVQgNJj01Ytzr5l-rPGsNX7ILLqgd10MEDS7PyOB9EaVUAc-hjb1E8UElAV5XOscUbwvPvtKxMSpJ36Jc6bu2f_uGAjKxfc1kp9IIPg1it6R01FK6UiG1&state=gx61xmn8bdgs4rmd4o8kqd
{“access_token”:“EAANHy9B9hMIBABdcZCULQAYOTG1pheHVqPnZAiIXxiIVb6qHGnouYB21CPSZAkr9nmVlLcG67qj8kpJ0Ct2UVcwo3nNpL5mHzEoAZBiVQdlXkOzPvWCFZB6rYQbBE4iKDE4Vy6ajui3BKYqMoohvxGj0dAGQaKZCNZCI0xmKsc2T3Ri4KqaL995TW4IAeRFjRwbPSeThTTfgwZDZD”,“token_type”:“bearer”,“expires_in”:5120072}