FB Login API Integration working smoothly in local DEV environment but failed in Wix

Issue

Since I am receiving the following error message: “URL blocked: This redirect failed because the redirect URI is not white-listed in the app’s client OAuth settings. Make sure that the client and web OAuth logins are on and add all your app domains as valid OAuth redirect URIs.”, my assumption is that I didn’t set the correct OAuth redirect URI.

I set the following redirect URI, but probably that’s not the correct one then? I tried multiple URIs already, but I keep receiving the error message.

Local DEV environment

I created a piece of code ( https://jsfiddle.net/yg2c5x0s/ ) to test the Facebook Login API, which works like a charm. See http://urbexco-acceptance.droppages.com/fb_login for a demo.

Update

I was able to figure out the right URI. The required format is the following:

https://SUBDOMAIN.wixsite.com/

Unfortunately, it didn’t solve my problem.

Now I receive the following error message: “Uncaught DOMException: Failed to set the ‘domain’ property on ‘Document’: Assignment is forbidden for sandboxed iframes.”

From following question on stackoverflow: https://stackoverflow.com/questions/34426959/loading-the-facebook-api-in-jsfiddle I learned that Facebook doesn’t allow to run their API within a Sandboxed iframe. Unfortunately that’s exactly what Wix does: “Code within the HTML element is displayed on your live site within a sandboxed iFrame. Using a sandbox protects visitors to Wix sites from potential side-effects of custom HTML/JS/CSS code. Usually, a sandboxed iFrame blocks the following: Using Browser APIs.” (Ref: https://support.wix.com/en/article/using-iframes-to-display-visible-content-on-your-site )

How can I solve this? Is there a way to integrate with the Facebook API through the backend of Wix? I’m afraid there is no other option…

Thanks,

Yves

Nobody who can help me with this?

Go back and read that page again fully as it clearly states ‘Premium sites are not sandboxed.’
https://support.wix.com/en/article/using-iframes-to-display-visible-content-on-your-site

Plus, as the Forum Guidelines state, have a search of this Corvid Forum before posting as you will often find an old post that can help you like here.
https://www.wix.com/corvid/forum/community-discussion/facebook-app-login-api
https://www.wix.com/corvid/forum/community-discussion/login-using-facebook-button

@givemeawhisky thanks for your response. Hence my question whether there is an option to go through the backend of Wix instead of working with an iFrame. This question wasn’t raised before. Also, when leveraging an iFrame, my Facebook APP_ID will be visible through the browser console, which is far from ideal…

I believe I found a potential solution to my problem. There’s an option to “manually” build the login flow: https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/#login I’m going to test this both through an iFrame and the backend of Wix.

Hi @vervoortyves ,

I too am suffering from this. Could you share with the community of your findings, and if it is possible to “manually” build the login flow?

Thanks

Any news?

@itsbkoz @saimon199128 I haven’t implemented this for now as it currently wasn’t worth the effort. A manual login flow requires quite some work. I decided to just ask for an e-mail address. I’ll do the integration later.

Just by reading about the way it works (calling a RESTful API) I believe it should work, as I also integrated with the Mailchimp API in the same way.