[Answered ]-Csrf token verification fails between two Django web applications

0👍

I wasn’t able to resolve it in your way, but I managed out how to do it:

C go directly to S via javascript opening a popup with:

window.open("http://<S_address>/<path_to_request_form>");

In this way, user using C that is logged via a third party authentication server (I forgot to mention it earlier, sorry), is still logged in the popup window in S and receives the form in it with a correct csrf token. I don’t know if it’s correct but it works.
Thanks for your time

👤gc5

1👍

Try defining your context and returning it like this…

context = RequestContext(request, {
  'request': request
})

return render_to_response(..., context_instance=context)
👤Dave

1👍

This is by design, and disallows for cross site POST execution. One option you have is to mark the methods you would like to be able to execute as safe, as per the django docs:

https://docs.djangoproject.com/en/dev/ref/contrib/csrf/

Leave a comment