Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authentication with ASP.NET Web API [duplicate]

Possible Duplicate:
Cross platform authentication using ASP.NET Web API

I want to create an asp.net web api with the new visual studio 11 beta. This web api will need to be accessed by different websites, desktop apps, and mobile apps. What is the best way to perform authentication/authorization for my web api. I need to make sure that all the apps calling the api are authenticated. Is there an easy way to do this with the new web api?

like image 940
MattMerrill Avatar asked Mar 22 '12 19:03

MattMerrill


Video Answer


1 Answers

I've done it by using a message handler to check for the auth header in the request and set up the identity so the [Authorize] attribute can do it's thing.

I've written a blog post on the subject..

like image 139
Antony Scott Avatar answered Sep 24 '22 08:09

Antony Scott