Question

I have had django-social-auth working for Google for quite some time now but am having problems with Facebook.

I am at the point where clicking on the /login/facebook/ link will take me to the Facebook authorization page. I then click "go to app" and it redirects me to my home page but does not log in or create a user but does put some strange "#=" onto the back of my URL.

Reading up on that, here https://developers.facebook.com/blog/post/552/, and here https://github.com/omab/django-social-auth/issues/199, it seems that would be happening if the redirect uri was not defined. However, on my facebook app settings, I have the following (replacing my site with example.com):
- App Namespace: "example"
- Site URL: "http://example.com/complete/facebook/"
- Site Domain: "example.com"
- Sandbox Mode: "On"
- Post-Authorize Redirect URL: "http://apps.facebook.com/example/"
- Deauthorize URL: "http://www.example.com/"
- Post-Authorize URL: "http://example.com/complete/facebook/"

The request that django-social-auth is sending to facebook is (replacing my info again): "https://www.facebook.com/dialog/oauth?scope=email&state=*&redirect_uri=http%3A%2F%2Fexample.com%2Fcomplete%2Ffacebook%2F%3Fredirect_state%3D***&client_id=*"

The /complete/facebook/ is what is in the documentation and google works as /complete/google/

What am I missing here?

Was it helpful?

Solution

My basic problem was in the urls.py. I had a catch-all URL which unfortunately also caught '/complete/facebook/'. Google wasn't caught because there was a '-' in the url.
May not be related but I also removed my deauthorize/post-authorize urls, and changed my site url to http://www.example.com/ (notice the www).
The "#_=_" thing looks like an ongoing bug according to http://developers.facebook.com/bugs/318390728250352?browse=search_5040e171d3ac02944460198 which just has to be removed manually

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