Actions
Issue #7888
closedCan't update Fields through Rest API We pages (PUT requests)
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
Master
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:
Description
Using rest api on pulp (PUT Request), I current Get the following error raised
{ "detail": "CSRF Failed: CSRF token missing or incorrect." }
Investigation¶
-
The root cause of this issue comes from the X-CRRFToken been checked but not sent through the Ajax Call
-
Source of this check comes from the authentication scheme in place (SessionAuthentication) (cf settings.py) 'DEFAULT_AUTHENTICATION_CLASSES': [ 'rest_framework.authentication.SessionAuthentication', 'rest_framework.authentication.BasicAuthentication', ]
Updated by pulpbot about 4 years ago
- Status changed from NEW to POST
Updated by dkliban@redhat.com almost 4 years ago
Does this occur when using the browsable API provided using django rest framework?
Updated by equipe_serveurs@exane.com almost 4 years ago
Yes it is indeed the case. This case is about using the API through the web interface.
Added by Frederic Brin almost 4 years ago
Updated by Anonymous almost 4 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulpcore|1e256df214451a80a381955a262609c6e8e65035.
Updated by pulpbot almost 4 years ago
Added by bmbouter almost 4 years ago
Updated by pulpbot almost 4 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions
Define window.drf.csrfToken in api.html
This variable is expected in csrf.js to get the X-CSRFToken / csrfHeaderName to be set.
If not http PUT on form update won't work.
Fixes: #7888