PHP application does not log into the facebook app by localhost

Asked

Viewed 13,394 times

6

I’m developing a PHP application that returns the list of facebook user friends. Although I specified the domain and site URL in the Facebbok app I created, I get the following message:

The given URL is not in the release list in the settings of Client oauth: Redirect failed because the Url used does not is on the release list in the client’s Oauth settings app. Make sure that the client’s Oauth login and web is active and add all domains of your app as Urls valid Oauth redirect paths.

I found that using the localhost address an error appeared, so I modified the Xampp settings to change the localhost smoothie to testeleonardo.com. I take this opportunity to ask: would it be possible for me to return all my friends' friends as well? Or would this be a violation of privacy?

Abaixo as configurações básicas do APP:

E as avançadas

  • has tried to place localhost?

3 answers

4

It’s very simple to fix this.

Open the /etc/hosts (unix) or C:\WINDOWS\system32\drivers\etc\hosts.

Assuming your domain is testeleonardo.com, add this line:

127.0.0.1    local.testeleonardo.com

So in your test, open up local.testeleonardo.com in your browser that should work.

Of course you could still put in the settings of the app on facebook the local url of the application for testing.

  • Hi Otto! I have already checked the hosts file as you mentioned and already access the localhost as testeleonardo.com. This works. What doesn’t work is authentication in the Facebook app, which generates the error.

  • You set the url la on facebook also partner ?

  • Configurei, as shown in the images above.

  • @Leopinheirodesouza the site_url needs to look like the hosts friend. Remember need to adapt the answer.

  • I did the adapatação: local.testeleonardo in all places. The error persists.

  • the error remains the same ? @Leopinheirodesouza

  • @Leopinheiroclear your <fb:Registration redirect_uri="http://localhost/callback-fb-Registered" /> this pointing to the correct location ?

  • take a look at this http://stackoverflow.com/questions/14667180/setting-up-facebook-login-on-localhost @Leopinheirodesouza

Show 4 more comments

1

To solve this problem you need to delete all domain information. Configuração Básica

And then configure the Login destination URL. Login do Facebook

0

In case someone still goes through this problem. In the field "Login with facebook" within Facebook Developers you should search through the field: "Valid Oauth redirect uris".

There you should put the return of facebook, in my case using the Laravel Socialite was: https://meudominio/login/facebook/callback.

After this procedure worked normally in production.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.