title: How to do both Azure Active Directory Single Sign On and Forms Authentications on ASP.NET MVC
body: <p>We have the legacy system developed by MVC 4 using Forms Authentication and Basic Authentication for Web API (there is no OWIN so far).</p>
  
  <p>Now we have lots of clients which want to do single sign on into our system, so we use Azure Active Directory (AAD) to store client's users.</p>
  
  <p>Now the situation is we want to revise the login workflow to adapt with AAD. The login page has no changes, under the hood, we check whether user exists on our system (using our database), it allows user to access. If not, we continue to check user on AAD, we don't want to re-direct to Azure login page in this case.</p>
  
  <p>I have done tons of reading but have not much clear how to do this? We also consider to upgrade to MVC 5 in order to use OWIN middleware authentication if it's fine with situation.</p>