facebookarchive / php-graph-sdk

The Facebook SDK for PHP provides a native interface to the Graph API and Facebook Login. https://developers.facebook.com/docs/php
Other
3.17k stars 1.95k forks source link

URL Blocked: This redirect failed because the redirect URI is not whitelisted #1180

Closed James467 closed 4 years ago

James467 commented 4 years ago

I contacted FB support, they said to come here. Please help, thank you.

This is an intermittent error. Each of my client’s login through this portal through my website. But only some get this error. The screenshot shows that the person logged in through the mobile app, I told him that he was unable to do this. That he needs to login on a desktop. He said he used a laptop and still got the same error. Please help, I don’t understand why some users just can’t log in and give my app permissions. APP ID: 1791751507733751 Redirect URL is always: https://www.lottoraiser.ie/StaffDoor/LocalLotteries_promotion_facebook.php

Your help would be greatly appreciated as I don’t know where to go from here Thank you Screenshot_20200225-163803_Chrome Untitled

bizmate commented 4 years ago

That error has nothing to do with PHP or this package most likely but what you are not showing that is critical is the full URL on the m.facebook site. Make sure the redirect URL is there and it is the right redirect url. Also show how your code works.

Not sure why Facebook told you to write here but add details and ideally send a bug at https://developers.facebook.com/support/bugs/

James467 commented 4 years ago

Yeah I don't know why FB would say that either. I think they just gave me the "Can't be bothered" run around.

It wasn't the code, which I literally copy and pasted from the PHP SDK help page... or the redirect URLS

I resolved it anyway, still FB not interested in what I discovered. I tried submitting bug report but no response for any of the help and bug requests. (Other than to say come here!?!)

You can report the PHP issue in the below channel. https://github.com/facebook/php-graph-sdk/issues Satish Feb 28, 2020, 3:48 PM

Oh to help a future person that might find this This error was caused by pages that are originally set up as a profile. If a Page was a profile it still as its own login details and in some cases another profile is created to be the admin of the converted Page. This really messes up the processes behind the scenes. So far I found two causes, (1) You cannot log in with the old details for the Converted page, OAuth will not accept it. (2) You cannot use the Newly created Profile of converted Page, logging in with that account doesn't work. You need to give Admin rights to a proper Profile, then Facebook will allow the login process and will function correctly.

At a guess the problem is that there must be another page, in the middle, redirecting the process from my Server to FB and to FB again, so when the login process gets the information from the middle FB URL, it doesn't pass the referrer URL and then fails the whitelisted check.