title: ASP.NET MVC 5 Identity and Azure
body: <p>I'm trying to publish a test website from the new <code>Visual Studio 2013 RC</code> to azure using the <code>MVC 5 spa template</code>. </p>
  
  <p>I can get the register / log in / log off process working just fine except there's a small issue that's bothering me. If I try to log in using bad credentials, the error string that comes back to the page is "An unknown error occurred." instead of "The user name or password is incorrect." as it should if <code>GrantResourceOwnerCredentials</code> in <code>ApplicationOAuthProvider.cs</code> is working properly.</p>
  
  <p>On localhost, I get back the correct "The user name or password is incorrect." message.</p>
  
  <p>Error log from Azure:</p>
  
  <pre><code>&lt;/head&gt; 
  &lt;body&gt; 
  &lt;div id="content"&gt; 
  &lt;div class="content-container"&gt; 
  &lt;h3&gt;HTTP Error 400.0 - Bad Request&lt;/h3&gt; 
  &lt;h4&gt;Bad Request&lt;/h4&gt; 
  &lt;/div&gt; 
  &lt;div class="content-container"&gt; 
  &lt;fieldset&gt;&lt;h4&gt;Most likely causes:&lt;/h4&gt; 
  &lt;ul&gt;    &lt;li&gt;&lt;/li&gt; &lt;/ul&gt; 
  &lt;/fieldset&gt; 
  &lt;/div&gt; 
  &lt;div class="content-container"&gt; 
  &lt;fieldset&gt;&lt;h4&gt;Things you can try:&lt;/h4&gt; 
  &lt;ul&gt;    &lt;li&gt;Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click &lt;a href="http://go.microsoft.com/fwlink/?LinkID=66439"&gt;here&lt;/a&gt;. &lt;/li&gt; &lt;/ul&gt; 
  &lt;/fieldset&gt; 
  &lt;/div&gt; 
  
  &lt;div class="content-container"&gt; 
  &lt;fieldset&gt;&lt;h4&gt;Detailed Error Information:&lt;/h4&gt; 
  &lt;div id="details-left"&gt; 
  &lt;table border="0" cellpadding="0" cellspacing="0"&gt; 
  &lt;tr class="alt"&gt;&lt;th&gt;Module&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;__DynamicModule_Microsoft.Owin.Host.SystemWeb.OwinHttpModule, Microsoft.Owin.Host.SystemWeb, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35_08fdea3d-9972-4dc2-b0fc-c8ffdb2e4253&lt;/td&gt;&lt;/tr&gt; 
  &lt;tr&gt;&lt;th&gt;Notification&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;AuthenticateRequest&lt;/td&gt;&lt;/tr&gt; 
  &lt;tr class="alt"&gt;&lt;th&gt;Handler&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ExtensionlessUrlHandler-Integrated-4.0&lt;/td&gt;&lt;/tr&gt; 
  &lt;tr&gt;&lt;th&gt;Error Code&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;0x00000000&lt;/td&gt;&lt;/tr&gt; 
  
  &lt;/table&gt; 
  &lt;/div&gt; 
  &lt;div id="details-right"&gt; 
  &lt;table border="0" cellpadding="0" cellspacing="0"&gt; 
  &lt;tr class="alt"&gt;&lt;th&gt;Requested URL&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;http://[site]:80/Token&lt;/td&gt;&lt;/tr&gt; 
  &lt;tr&gt;&lt;th&gt;Physical Path&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;C:\DWASFiles\Sites\[site]\VirtualDirectory0\site\wwwroot\Token&lt;/td&gt;&lt;/tr&gt; 
  &lt;tr class="alt"&gt;&lt;th&gt;Logon Method&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Not yet determined&lt;/td&gt;&lt;/tr&gt; 
  &lt;tr&gt;&lt;th&gt;Logon User&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Not yet determined&lt;/td&gt;&lt;/tr&gt; 
  
  &lt;/table&gt; 
  &lt;div class="clear"&gt;&lt;/div&gt; 
  &lt;/div&gt; 
  &lt;/fieldset&gt; 
  &lt;/div&gt; 
  
  &lt;div class="content-container"&gt; 
  &lt;fieldset&gt;&lt;h4&gt;More Information:&lt;/h4&gt; 
  The request could not be understood by the server due to malformed syntax. 
  &lt;p&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=62293&amp;amp;IIS70Error=400,0,0x00000000,9200"&gt;View more information &amp;raquo;&lt;/a&gt;&lt;/p&gt; 
  &lt;p&gt;Microsoft Knowledge Base Articles:&lt;/p&gt; 
  </code></pre>
  
  <p>I'm not sure how it could be malformed syntax since the same syntax is sent and processed when correct login credentials are submitted.</p>
  
  <p>Does anyone have enough familiarity with this to know what's going on, or at least a path to go down to get closer to an answer other than the knowledge base article? If it's not obvious already, I'm new to this - it's my first website in ASP.NET, first introduction to OAuth, and first use of Azure.</p>