Django allauth facebook local development

I use django-allauth to authenticate Facebook in development for the site and configured accordingly:

in facebook app settings on facebok:

Namespace: test_login App Domains: blank Site URL: http://127.0.0.1:8000/ Canvas URL: http://127.0.0.1:8000/ Secure Canvas URL: https://127.0.0.1:8000/ 

in Django admin I created a new social application:

 Provider: Facebook name: test_login client_id: xxx Secret: xxx Sites: http://127.0.0.1:8000/ 

as you can see, I added a new site http://127.0.0.1:8000/ instead of example.com .

SITE_ID in settings.py is correct.

So, everything should work, but it is not. After clicking on the login via Facebook I get

 Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App domains. 

What am I missing? What is not configured? As far as I understand, I should use 127.0.0.1:8000 for testing.

+4
source share
2 answers

This helped me configure the Facebook URL as localhost instead of 127.0.0.1. Also pass localhost:8000 to ./manage.py runserver

+8
source

I had the same problem an hour ago. I fixed it by setting the Site URL and Valid OAuth redirect URIs to http://fuf.me:8080 . fuf.me points to 127.0.0.1, so your localhost as well as I changed the default port 8000 to 8080. You can do this by running python manage.py runserver localhost:8080

I also included the OAuthLogin browser and WebOauthLogin.

0
source

Source: https://habr.com/ru/post/1480500/


All Articles