Wednesday, May 23, 2018

Authenticate MVC project using web api

OWin and asp.net Identitiy model are great at adding robust and feature-rich authentication in an MVC project. But there could be a case where we would like the authentication to be handles by a web service and allow the MVC application to simply act as user interface.

The blog post below explains how this can be achieved in detail along with code sample.

https://levelnis.co.uk/blog/how-can-you-use-webapi-to-authenticate-users-of-your-mvc-application

Also, this github archive has a custom implementation of SignInManager class in Identity Model

https://github.com/Legends/Custom-SignInManager-for-MVC-5/blob/master/ApplicationSignInManager.cs

No comments:

c# httpclient The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch

 If we get this error while trying to get http reponse using HttpClient object, it could mean that certificate validation fails for the remo...