0

I'm experimenting with a way of knowing the specific twitter identities of my site's users even though they're not logged in. And would like the help of the community to find out how I could reduce the possibility of impersonation.

The main idea is that a user comes to the main page, fills a form, and clicks on a "tweet this" button as a way to submit the form. That opens up a popup where the user sees a pre-filled message: "I just submitted this form" and tweets it. This popup resides on twitter.com. No oauth is involved here. When the tweet is done, twitter sends back the id of the tweet that was just created to a javascript callback function on the web page. This javascript function ajax POSTs the form fields as well as the tweet id to a handler on the server.

The server then fetches the twitter information of that tweet including the user info and saves the form info with a foreign key to the user.

What I want to avoid is for an impersonator to come to the page, fill up the form with junk, and manually POST the form including a tweet id to an unrelated tweet from another user.

Django, which I'm using, has something called CSRF tokens to avoid impersonators from doing POST calls without loading the page. But I'm not sure if this would also prevent users who load the page (and see the csrf token) to fake the POST.

The main thing I want to avoid is for people to associate a twitter id that is not theirs with a for that they post.

Looking forward to your suggestions of some creative ways to solve this or to poke holes at my thinking.

David Haddad
  • 3,796
  • 8
  • 32
  • 40
  • 1
    I think if you want to really find out your visitor's twitter accounts, you have to ask them to dance the OAuth with you. That's what it's for. It is also more transparent for them. I don't know if I would like a website to store my twitter handle without my permission. This might even be against Twitter's TOS. – Thilo Jul 24 '12 at 09:46
  • Thanks Thilo. In the flow, it's clear to users that their info will be stored. Which I disagree with you that it's a big issue since any website can store your handle purely by looking at the public timeline. We can talk about the benefits from a marketing/usability standpoint for both cases. But this is a technical question and I'm interested in solutions to the twitter id forgery issue. – David Haddad Jul 24 '12 at 09:52
  • Well, the forgery is where OAuth comes in. You cannot look at my public timeline to find out my handle, because you cannot access my public timeline without knowing my handle in the first place. OAuth is the best way to get a "verified" handle. – Thilo Jul 24 '12 at 09:54

0 Answers0