Web api open oauth (DotNetOpenAuth) mvc 4

The mvc 4 web app has a great feature that can easily integrate with facebook twitter and google. But there is no such function in the api web template. How can I easily integrate DotNetOpenAuth with web api? Have a tutorial?

+5
asp.net-mvc-4 dotnetopenauth
source share
1 answer

MVC is a browser-oriented website. The WebAPI is designed to access the software by some client other than the browser web page (although it may be javascript running in the browser). Thus, OpenID or OAuth input streams that require browser redirection do not make sense for WebAPI. Not in any case.

What seems to apply is that you want your WebAPI to be authorized, and to know which user they represent. In general, the OAuth 2 resource server acts for WebAPI, which accepts access tokens issued by the authorization server, which really accepts Facebook, Twitter, and Google for users to log in before minting these access tokens.

These are some examples of WebAPI. Here is one .

+7
source share

All Articles