Balaji Chandrasekaran
Balaji Chandrasekaran

Reputation: 512

can we really, post update to twitter with oAuth Token , secret just like facebook access_tocken?

Hi i am wasting around two days with it.

can we really, post update to twitter with oAuth Token , secret just like facebook access_tocken?

i will save access_token to database and will use it later to post update.

But when i try with twitter it doesn't work can any one help me with it.

Upvotes: 1

Views: 689

Answers (1)

DWRoelands
DWRoelands

Reputation: 4940

To post to Twitter via OAuth, there are FOUR tokens that you need.

  1. Consumer Token - Twitter gives this to you when you register your application at Twitter.com
  2. Consumer Token Secret - Same as above.
  3. OAuth Token - This token is assigned to your application's user after they have authorized your application to use their Twitter account.
  4. OAuth Token Secreat - Same as above.

Tokens 1 and 2 are probably hardcoded into your application (this is a security problem, but there are not many easy ways around this because of Twitter's implementation of OAuth).

Tokens 3 and 4 are given to you when your user authorizes you application to use his account. When you application gets them, you should put them into some sort of data store (cookies, database, whatever) so that they can be retrieved the next time your user wants to post to Twitter.

All four tokens are used each time a request is sent to Twitter.

I strongly advise you to consider using an existing library if one is available to you. The OAuth problem has been solved over and over again for just about every development platform. This is a wheel that does not need reinventing.

Upvotes: 4

Related Questions