Mosh
Mosh

Reputation: 6044

ASP.NET Web API Authentication (Web + Mobile)

I'm designing a solution that involves ASP.NET Web API as the service layer plus clients for web, iOS and Android.

Web users should be able to log into the web site and do their stuff. I'm using Forms Authentication for this scenario.

Mobile users should use the REST API and I believe we need a different authentication mechanism here.

Assuming that a given ASP.NET MVC application can support only 1 authentication mode, do I need to create 2 separate applications, one as the web client with Forms Authentication, and one as the API, and host them separately?

Any advice would be appreciated.

Upvotes: 2

Views: 2538

Answers (1)

leastprivilege
leastprivilege

Reputation: 18482

You could do basic authentication for the service clients and combine that with your existing forms auth

http://leastprivilege.com/2012/10/23/mixing-mvc-forms-authentication-and-web-api-basic-authentication/

Upvotes: 1

Related Questions