Closed annshress closed 6 years ago
You need to send same value in header and in cookies: https://docs.djangoproject.com/en/1.10/ref/csrf/#ajax
Thanks, your solution helps. But still, I keep getting 400 Bad request.
views.BaseSocialAuthView.post method keeps catching an AuthCanceled exception.
my post params has follows in body: code: //facebook user access token// provider:facebook csrfmiddlewaretoken://csrf token//
and request header has: csrfmiddlewaretoken://same csrf token//
Does example project work for you?
Nope my settings.py extra configs REST_SOCIAL_OAUTH_REDIRECT_URI = '/' REST_SOCIAL_DOMAIN_FROM_ORIGIN = True
bad response: _ERROR:rest_social_auth.views: Authentication process canceled; ; {u'error': {u'message': u"redirect_uri isn't an absolute URI. Check RFC 3986.", u'code': 191, u'type': u'OAuthException', u'fbtraceid': u'G27RnD9w5GC'}} (2017-02-20 09:11:47; views.py:193)
Did you manage to get around the CSRF error?
Yes, it was issue related CORS.
For AJAX request, we used credentials=true and send a csrfmiddlewaretoken=
Guys, I can't reproduce it with example project. Fill free to reopen if the issue still exists.
Trying to use session based authentication from rest-social-auth. Cant figure a way to avoid csrf token validation.