views:

748

answers:

2

I'm trying to understand how to apply the oAuth consumer library from DotNetOpenAuth in the context of ASP.NET MVC.

oAuth is new to me, and the library doesn't seem very simple. Does anyone have a sample of leveraging this library, for this usage, in ASP.NET MVC?

+1  A: 

Have a look at Rob Conery's TekPub ASP.Net MVC 2.0 Starter Site. He has setup DotNetOpenAuth as part of that. It should point you in the right direction

EDIT
My assumption was based on the the fact the OpenID and OAuth are the same. They are not the same but complimentary ideas. OpenId is about Authentication where as OAuth is about Authorization.

While not directly related to ASP.NET MVC the TweetSharp Library has an OAuth implementation written in C# that may be of some use.

TweetSharp OAuth workflow
Simple OAuth integration for Twitter in ASP.NET MVC

OAuth with Silverlight for Windows Phone 7

Nathan Fisher
Thanks for the link Nathan, however it doesn't appear that Rob has any oAuth implementation in the Starter Site.
nikmd23
@nikmd23 I did make the assumtion that OpenId and OAuth are the same. My apologies if that is not the case. Have a look in the Controllers/SessionController Authenticate method and the Views/Session/Create.aspx file. The implementation that I was referring to is there.
Nathan Fisher
Added a couple of links that may be of value
Nathan Fisher
A: 

You may want to look at the sample projects that come along with the dotnetopenauth zip file (https://www.ohloh.net/p/dotnetopenauth/download?package=DotNetOpenAuth&release=3.4.5). The solution obtained on unzipping has several sample projects in it. One of them is an Oauth consumer implementation. Though it is a asp.net webforms application, reimplementing it as an mvc application shouldn't be too hard. Hope that helps.

Amrit