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:

Regex Email validation in c# dot net core

 Use this regex /^_?[a-zA-Z0-9]([a-zA-Z0-9]*[._+-])*[a-zA-Z0-9_]+@(?!-)[A-Za-z0-9-]{1,63}(?<!-)(\.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*\.[A-...