title: Web app(MVC 5),web api 2, native Android and iOS to use one mode of authentication?
body: <p>I need to develop an application in MVC 5, Xamarin Android and iOS application; as these applications have the same features, i have Web API 2 for all common operations except one! <strong>Authentication!</strong> </p>
  
  <p>I would want all the above applications to use <strong>ONE</strong> authentication framework/architecture either ASP.Net Identity 2.0, Web API token based authentication or any other you suggest.</p>
  
  <ol>
  <li>Successfully implement ASP.Net Identity 2.0 for my MVC 5 app, but couldn't authenticate the Web API with [Authorize] attribute (tried both System.Web.Http and System.Web.Mvc). Hence did not even think of trying for mobile apps yet.</li>
  <li><p>Successfully implement Web API token based authentication for my Web API and MVC 5 as well, but with lots of JavaScript variable storage (which obviously not right). Tried to authenticate the MVC 5 app with [Authorize] attribute (tried both System.Web.Http and System.Web.Mvc) the page either shows 401 Unauthorized if the token is not yet granted and once the token is granted the view opens, and doesn't get authenticated even after the token's validity is expired, this works on when I use [System.Web.Mvc.Authorize] attribute. I have a sample to implement on mobile but did not try yet.</p>
  
  <p><em>I feel that I am not implementing this part perfectly, if I get a proper tutorial to use token based authentication for all Web API, MVC and mobile applications then nothing like that.</em> </p></li>
  </ol>
  
  <p>I do not wish to use either Angular or knockOut JS. If this would be the only solution then I would opt it for sure.</p>
  
  <p>Thanks :)</p>