2

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..?

Mr_Green
  • 40,727
  • 45
  • 159
  • 271
Gowri
  • 209
  • 1
  • 4
  • 12
  • I am not sure that can happen. Twitter works based on Oauth and it needs the secret key or the auth token. – Ravi Y Dec 01 '12 at 06:46
  • Once try asking on [**`linqtotwitter.codeplex.com/discussions`**](http://linqtotwitter.codeplex.com/discussions) too – Mr_Green Dec 01 '12 at 06:46
  • @ryadavilli Is there any other chance to solve my problem.. – Gowri Dec 01 '12 at 06:57
  • As Mr Green suggested, it is better to check discussion forum of the library that you are using. You might get better responses. – Ravi Y Dec 01 '12 at 06:58
  • @ryadavilli Ya..I posted my problem in that forum...waiting for response.. – Gowri Dec 01 '12 at 07:00
  • @Gowri you are welcome.. If you got answer for your question there(codeplex) then dont forget to post as an answer here too. (Will be helpful for others) – Mr_Green Dec 01 '12 at 07:01

1 Answers1

0

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

Joe Mayo
  • 7,501
  • 7
  • 41
  • 60
  • Thx for the response.. I'm still confusion how to authenticate multiple users using a single Twitter APP...Please provide is there any examples are references... – Gowri Dec 03 '12 at 02:58
  • After the user authenticates, associate the OAuthToken/AccessToken with the user and persist it - implementation depends on the technology you're using. i.e. WPF, ASP.NET, Windows Phone, or Windows 8. I don't have any complete applications to share but here are some samples for different technologies: http://bit.ly/LReF65. – Joe Mayo Dec 03 '12 at 05:25
  • Thanks Joe.I got some idea after refer those examples... Tell me is it possible to get consumer key and consumer secret through programatically (c#). – Gowri Dec 03 '12 at 07:06
  • You can only get ConsumerKey/ConsumerSecret via Twitter App page. Once you have them, they don't change and you set them only one time for your app. – Joe Mayo Dec 03 '12 at 12:27