Question

I'm trying to login with my FB-account on my website http://www.example.com/index.php. I have replaced the AppId && Secret. I have also added a website-platform in the settings where I've set the "Site URL" to http://www.example.com/

But when I do $facebook->getUser() it always returns 0. And when I insert the login-link with $facebook->getLoginUrl() and I click on the link it redirects me to

https://www.facebook.com/dialog/oauth?client_id=AppId...

On this page facebook tells me that my App-Settings don't allow the URL

Was it helpful?

Solution

You have to configure this in your Developer Console on facebook.

It's under Settings> App Domains

note that if you just do "www.example.com" - then you will need to make sure that the API request is coming from "www.example.com" - and not "example.com"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top