Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

App only Authentication Howto

yut831 edited this page Jun 21, 2014 · 3 revisions

In CoreTweet, app-only authentication is not so difficult; just use OAuth2Token class instead of Tokens.

You can authorize app-only token by this easy code:

OAuth2Token apponly = OAuth2.GetToken("consumer key", "consumer secret");

And just use :)

foreach(var status in apponly.Search.Tweets(q => "tea"))
    Console.WriteLine("{0}: {1}", status.User.ScreenName, status.Text);

It is better to save the bearer token to use it later:

string bearer = apponly.BearerToken;

// later
var apponly2 = OAuth2Token.Create(consumerKey, consumerSecret, bearer);