简体   繁体   中英

Post status on twitter using c#

I am using Linq 2 twitter library..

I want to post a status for that I created an "Sampleapp" in twitter api. By using this library I can post message into "My twitter account" with the help of consumer key and consumer secret.

Now my question is how can others post messages with the help of my sampleapp without using consumer key and consumer secret.(Just using their userid and password)

Is this possible? Any suggestions..?

The Twitter API doesn't support username and password anymore. They move to OAuth exclusively a couple years ago, but only some of the API's required authentication - that was v1.0. Recently, the Twitter API introduced v1.1, which LINQ to Twitter supports. The Twitter API v1.1 requires OAuth on all queries and commands. So, LINQ to Twitter is supporting the type of authentication as the Twitter API.

That said, here's a couple tips that might make your user's experience much better. You would include your application's ConsumerKey and ConsumerSecret, which won't change, but don't require the user to obtain separate ConsumerSecret/ConsumerKey pairs. In fact, this is the way OAuth is intended to work.

Another tip is that Twitter authentication tokens don't expire for a user. This means you can ask the user to authenticate one time, during sign-up, and then save their credentials after they're authenticated. The credentials are available via the authorizer you used to do the OAuth process. After that, just re-use the saved credentials, loading all four credentials into the authorizer and LINQ to Twitter will just do (signed) queries without making the user authenticate again.

BTW, I watch the linq-to-twitter tag here on SO and have a CodePlex.com discussion forum. I'm on Twitter too, but sometimes answers like this are challenging via a tweet - though I have been known to tweet an answer or two. :)

@JoeMayo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM