How should I implement OAuth for an application? [closed] How should I implement OAuth for an application? [closed] asp.net asp.net

How should I implement OAuth for an application? [closed]


First, there is really no point in using external libraries if you are on net 4.5 where the default asp.net template comes with authentication code for most of these mentioned providers.

Second, if you still need a good tutorial on some details of oauth2 authentication, take a look at this great post by Ben Foster http://ben.onfabrik.com/posts/oauth-providers

Third, unfortunately, if you need anything else than authentiation, there is no single protocol. Thus, each provider has its own way of exposing these additional data - contacts, posts etc. You can't do much about it, it has nothing to do with oauth2 but is just a way of invoking a specific api which by chance is often exposed as rest/xml web services based on oauth2 authentication. This means that if you do authentication only, the protocol is mostly the same for each provider. Anything more is specific.

Fourth, I would stick with the email address returned by a provider rather than internal id. Not all providers support the id whereas all of them can return user email. And you can trust this information as providers verify emails before they return it via oauth2.


I suggest you use World Domination from PureKrome, it's trivial to use, well documented and very nice!

https://github.com/PureKrome/WorldDomination.Web.Authentication

It handles Twitter, Google, Facebook et al with simple one line configurations, and it handles everything else.

The creator hangs around n jabbr.net a lot as well.


The ASP.NET MVC 4 'Internet Application' template has DotNetOpenAuth implemented on it, you should take a look at that if you haven't already.