1

I have an existing ASP.NET MVC Web App with individual user accounts , but I want to create a mobile app for the web app. I got stuck on the authentication part, because I want to support web api authentication in my same mvc project.

How can I add web api authentication to mvc project? Any help is appreciated , Thanks

  • here some links that could be helpful: https://stackoverflow.com/questions/28116565/asp-net-web-api-with-custom-authentication http://bitoftech.net/2015/01/21/asp-net-identity-2-with-asp-net-web-api-2-accounts-management/ – Andrey Ischencko Sep 19 '17 at 14:06
  • "web api authentication" is not a thing in itself. By what method would you like the mobile app to authenticate to the API? You could use the same user accounts, in fact. That would make sense, if the user logs into the mobile app with the same credentials as they would the MVC app. – ADyson Sep 19 '17 at 14:54
  • @ADyson , Of course users will login on there same accounts as mvc, and that is exactly what i am asking about, how can I achieve this on the same project and what is the best way to do it? – Khalid Shadid Sep 20 '17 at 13:07
  • Have you read this? https://learn.microsoft.com/en-us/aspnet/web-api/overview/security/individual-accounts-in-web-api If you're using Individual Accounts as you mention, then this should be a starting point. The UI is shown as web-based but the key thing is the HTTP requests it generates, the the use of the auth token. The links that Andrey gave above are also worth reading. It's a biggish topic. – ADyson Sep 20 '17 at 13:51

0 Answers0