# Identity Token (Rails 2) and REST APIs

**URL:** <https://www.ruby-forum.com/t/identity-token-rails-2-and-rest-apis/154602>\
**Category:** Ruby\
**Created:** [December 2, 2008, 3:03am UTC](https://www.ruby-forum.com/t/identity-token-rails-2-and-rest-apis/154602 "2008-12-02T03:03:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![e\_deleflie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/858c86/32.png) [@e\_deleflie](https://www.ruby-forum.com/u/e_deleflie)\
**Post date:** [December 2, 2008, 3:03am UTC](https://www.ruby-forum.com/t/identity-token-rails-2-and-rest-apis/154602/1 "2008-12-02T03:03:12Z")

</div>

All,

I’ve got a remote application that is used for posting data to my  
Rails 2 app. Took me about a day to realise that my posting wasn’t  
working because my submitted form did not contain an identity token  
(introduced into Rails 2).

I can remove that function (on new posts) by doing:  
protect\_from\_forgery :only =\> [:update, :destroy]

but I’m wondering how I could keep that feature and still post from my  
client side app?

Etienne

---

<div class="post-metadata">

**Author:** ![e\_deleflie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/858c86/32.png) [@e\_deleflie](https://www.ruby-forum.com/u/e_deleflie)\
**Post date:** [December 2, 2008, 2:42pm UTC](https://www.ruby-forum.com/t/identity-token-rails-2-and-rest-apis/154602/2 "2008-12-02T14:42:44Z")

</div>

> I’ve got a remote application that is used for posting data to my  
> Rails 2 app. Took me about a day to realise that my posting wasn’t  
> working because my submitted form did not contain an identity token  
> (introduced into Rails 2).
> 
> I can remove that function (on new posts) by doing:  
> protect\_from\_forgery :only =\> [:update, :destroy]
> 
> but I’m wondering how I could keep that feature and still post from my  
> client side app?

Probably best asked on a Rails mailing list, as it’s very specific to  
the Rails framework. This list is for the Ruby programming language.
