title: How to get OAuth working on MVC4 mobile
body: <p>I have been struggling to get OAuth to work on my MVC4 mobile application.</p>
  
  <p>I basically</p>
  
  <ol>
  <li>Created an MVC4 Mobile application</li>
  <li>Created an MVC4 Web application</li>
  <li>Copied the AccountController, AccountModel, InitializeSimpleMembershipAttribute and all account views into my MVC4 Mobile application</li>
  <li>Enabled Google and Facebook OAuth providers</li>
  <li>I also ensured RoleManager was initialized according to <a href="https://stackoverflow.com/questions/12254701/simplemembershipprovider-not-working" title="simplemembershipprovider-not-working">simplemembershipprovider-not-working</a>, although I do not think that was important. ( I needed it for some role-based security I was testing)</li>
  <li>Disabled ajax ( I think) by setting data-ajax="false": 
  <code>using (Html.BeginForm("ExternalLogin", "Account",new RouteValueDictionary { { "ReturnUrl", ViewBag.ReturnUrl } }, FormMethod.Post, new Dictionary&lt;string, object&gt; { { "data-ajax", false } }))</code> (This did not seem to have any effect on the page - so I may be doing something wrong here...)</li>
  </ol>
  
  <p>I can get to the LogIn view /Account/Login, and when I click the google button, the debugger breaks into <code>public ActionResult ExternalLogin(string provider, string returnUrl)</code></p>
  
  <p>However - the <code>public ActionResult ExternalLoginCallback(string returnUrl)</code> is never hit.
  Visually, I get the jquery mobile "page loading" animation - then I get "Error Loading Page"</p>
  
  <p>I have two questions:</p>
  
  <ol>
  <li>How can I get more information when I try to figure out what happens?</li>
  <li>How can I get OAuth working on my MVC4 mobile site?</li>
  </ol>
  
  <p>BTW: Both sites target .Net4.0</p>