OAuth libraries come in all shapes and sizes, however in the .Net land, they only come in one - extra large. This library is made to rectify that. It's a small (~15kb) library, with no dependencies that lets you create WebRequest's and sign them to your hearts content. Some of the features:
Please note, this is for client applications only. You'll need to find something else if you're looking for a server, for example, DevDefined.OAuth.
Well, OK then!
var tokens = new Tokens() { ConsumerKey = "key", ConsumerSecret = "secret",
AccessKey = "key", AccessKeySecret = "secret" };
var request = WebRequest.Create("https://api.twitter.com/1/statuses/home_timeline.json?count=5");
request.SignRequest()
.WithTokens(tokens)
.InHeader();
Or, you can condense your WithTokens
call into the SignRequest
request.SignRequest(tokens).InHeader();
Made OAuth simple, and I hope you find it really does.
You'll find the source above and a solution that's fine for Visual Studio 2010. It is targeting to .Net version 3.0, so if you're using a version of Visual Studio 2008 you can create a new solution, import the project, and you should be good to go.
There are also three examples,
Finally, you'll find a Compiled Help file in the Help directory that documents it.
Simple OAuth .Net is licensed under the terms of the MIT License, see the included LICENSE file.