I am working on a Django web application in which I have to implement social authentication using Facebook (reference - Django 4 By Example). I have installed the required python packages social_django
, django_extensions
and I am operating the website on https
as mentioned in the book.
- Edited the hosts file of my machine to serve domain name of my choice, in
ALLOWED_HOSTS
setting added the domain name. - I have created the app using Facebook's developers account and have kept the settings as mentioned in the book and added domain name in the required field.
- In main app's
urls.py
I have added a pathsocial_auth
. - I have added the redirect url in
Valid OAuth Redirect URIs
field.
The site is running perfectly on https
with custom domain name, but I am getting this error -
URL blocked: This redirect failed because the redirect URI is not whitelisted 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.
I hope the reader understands my problem I have tried to keep it as simple as possible, I am following Django 4 By Example Chapter 5. Thanks
I checked online solution in which they mentioned to make changes to Valid OAuth Redirect URIs
field and add /people/auth/facebook/callback
at the end of the domain name. Please check - https://help.sharetribe.com/en/articles/1317674-facebook-error-url-blocked-this-redirect-failed-because