Project

General

Profile

Actions

Defect #15424

closed

Filter chain halted as :verify_authenticity_token rendered or redirected

Added by Marco Descher over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Category:
REST API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Duplicate
Affected version:

Description

When executing a post request to creat a User using a Java Jersey client and the API access key, I get the following error:

Started POST "/users.xml?key=984434......." for 194.208.16.210 at 2013-11-21 10:01:43 +0100
Processing by UsersController#create as XML
  Parameters: {"user"=>{"id"=>"0", "login"=>"jdoe", "firstname"=>"John", "lastname"=>"Doe", "mail"=>"john@doe.at", "password"=>"[FILTERED]", "created_on"=>"2013-11-21T10:01:43.650+01:00"}, "key"=>"984434......."}
WARNING: Can't verify CSRF token authenticity
API calls must include a proper Content-type header (application/xml or application/json).
Filter chain halted as :verify_authenticity_token rendered or redirected
Completed 422 Unprocessable Entity in 0.4ms (ActiveRecord: 0.0ms)

I do not find a way to get the resp. Token via REST, is there even one provided?

According to http://stackoverflow.com/questions/10167956/rails-shows-warning-cant-verify-csrf-token-authenticity-from-a-restkit-post it would be safe to remove :verify_authenticity_token for calls coming via API.


Files

output.png (145 KB) output.png Http4E Paket Marco Descher, 2013-11-21 11:29

Related issues

Related to Redmine - Defect #10780: Logout by using POST REST APINeeds feedback

Actions
Is duplicate of Redmine - Defect #15427: REST API POST and PUT brokenClosedJean-Philippe Lang

Actions
Actions

Also available in: Atom PDF