title: Log in using custom external provider - ASP.Net MVC 5
body: <p>Bottom line, I want to create a new provider for logging in to my web.</p>
  
  <p>The big picture.
  We are developing hybrid mobile application using ASP.Net MVC5 (with angular on front).</p>
  
  <p>The entire application is based on web view except of the log in page.
  The user can log in using his Facebook and Google account. This is done 100% by the native application (we have to do that way in order to invoke the mobile app and not the browser i.e open the Facebook/Google mobile application).
  After the native application get the confirmation from the external provider it should log in to my website.</p>
  
  <p>I had 2 ideas of doing it. The first was that the native application will send me(the ASP web application) the user email address (using Restful service) and some encrypted data, I will decode and validate it and if everything alright I'll sign in the user and return the authentication cookie.
  The second idea was to do it in 2 steps, the native app will send the username and a token, then I (the ASP web application) will send back the token and receive an answer if the token is genuine and valid. If it is, then I will log in the user and return an authentication cookie.</p>
  
  <p>In both ways I have 2 problems:</p>
  
  <ol>
  <li>I don't know how to sign in a user with no username/password or Facebook/Google. How do I do it?</li>
  <li>I don't know how to manually return authentication cookie.</li>
  </ol>
  
  <p>The real problem is that until now I've only used the identity feature in the classic way.</p>
  
  <p>Thanks from advance,
  Shaul</p>