2

我正在尝试Visual Studio 2013 RC使用MVC 5 spa template.

我可以让注册/登录/注销过程正常工作,除非有一个小问题困扰着我。如果我尝试使用错误的凭据登录,返回页面的错误字符串是“发生未知错误”。而不是“用户名或密码不正确”。如果GrantResourceOwnerCredentialsinApplicationOAuthProvider.cs工作正常,它应该是这样。

在 localhost 上,我得到正确的“用户名或密码不正确”。信息。

Azure 的错误日志:

</head> 
<body> 
<div id="content"> 
<div class="content-container"> 
<h3>HTTP Error 400.0 - Bad Request</h3> 
<h4>Bad Request</h4> 
</div> 
<div class="content-container"> 
<fieldset><h4>Most likely causes:</h4> 
<ul>    <li></li> </ul> 
</fieldset> 
</div> 
<div class="content-container"> 
<fieldset><h4>Things you can try:</h4> 
<ul>    <li>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 <a href="http://go.microsoft.com/fwlink/?LinkID=66439">here</a>. </li> </ul> 
</fieldset> 
</div> 

<div class="content-container"> 
<fieldset><h4>Detailed Error Information:</h4> 
<div id="details-left"> 
<table border="0" cellpadding="0" cellspacing="0"> 
<tr class="alt"><th>Module</th><td>&nbsp;&nbsp;&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</td></tr> 
<tr><th>Notification</th><td>&nbsp;&nbsp;&nbsp;AuthenticateRequest</td></tr> 
<tr class="alt"><th>Handler</th><td>&nbsp;&nbsp;&nbsp;ExtensionlessUrlHandler-Integrated-4.0</td></tr> 
<tr><th>Error Code</th><td>&nbsp;&nbsp;&nbsp;0x00000000</td></tr> 

</table> 
</div> 
<div id="details-right"> 
<table border="0" cellpadding="0" cellspacing="0"> 
<tr class="alt"><th>Requested URL</th><td>&nbsp;&nbsp;&nbsp;http://[site]:80/Token</td></tr> 
<tr><th>Physical Path</th><td>&nbsp;&nbsp;&nbsp;C:\DWASFiles\Sites\[site]\VirtualDirectory0\site\wwwroot\Token</td></tr> 
<tr class="alt"><th>Logon Method</th><td>&nbsp;&nbsp;&nbsp;Not yet determined</td></tr> 
<tr><th>Logon User</th><td>&nbsp;&nbsp;&nbsp;Not yet determined</td></tr> 

</table> 
<div class="clear"></div> 
</div> 
</fieldset> 
</div> 

<div class="content-container"> 
<fieldset><h4>More Information:</h4> 
The request could not be understood by the server due to malformed syntax. 
<p><a href="http://go.microsoft.com/fwlink/?LinkID=62293&amp;IIS70Error=400,0,0x00000000,9200">View more information &raquo;</a></p> 
<p>Microsoft Knowledge Base Articles:</p> 

我不确定它怎么可能是格式错误的语法,因为在提交正确的登录凭据时会发送和处理相同的语法。

有没有人对此有足够的了解,可以知道发生了什么,或者至少有一条途径可以接近知识库文章以外的答案?如果还不是很明显,我是新手——这是我在 ASP.NET 中的第一个网站,第一次介绍 OAuth,第一次使用 Azure。

4

1 回答 1

0

由于这已经被查看了几次,我只想添加一个更新/答案。我从来没有发现问题是什么,但在更新到 Visual Studio 2013 RTM 后它就消失了。RTM 中的 ASP.Identity 有很多更新,所以我不确定是什么修复了它(它甚至可能与 VS 无关,并且通过我所知道的应用于 Azure 的更新得到修复),但希望任何有同样问题的人也看到它消失了。

于 2013-10-31T02:32:54.750 回答