0

我有一个<cflogin>用于身份验证的 Web 服务启动并运行,当您提供有效的用户名/密码时,一切都按预期工作。我遇到的问题是,如果身份验证在一侧(客户端)失败<cfinvoke>,我会收到一个巨大的数据错误转储,而不是从服务返回的正常错误消息(即:“错误的用户名和/或密码。请联系您的管理员”)。

我正在使用 cflogin 方法来保护 Web 服务,如下所述:help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec13a13-7fe0.html

这是我在提供错误的用户名/和/或/密码时返回的 CFDUMP (DUMP.Diagnostics) 的片段:

Cannot perform web service invocation service_name. The fault returned when invoking the web service operation is:<br> <pre>AxisFault faultCode: {http://xml.apache.org/axis/}HTTP faultSubcode: faultString: (401)Unauthorized faultActor: faultNode: faultDetail: {}:return code: 401 &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt; &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt; &lt;head&gt; &lt;title&gt;IIS 7.5 Detailed Error - 401.5 - Unauthorized&lt;/title&gt; &lt;style type=&quot;text/css&quot;&gt; &lt;!-- body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;background:#CBE1EF;} code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;} .config_source code{font-size:.8em;color:#000000;} pre{margin:0;font-size:1.4em;word-wrap:break-word;} ul,ol{margin:10px 0 10px 40px;} ul.first,ol.first{margin-top:5px;} fieldset{padding:0 15px 10px 15px;} .summary-container fieldset{padding-bottom:5px;margin-top:4px;} legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;} legend... ''</pre> <br>The error occurred on line 25.

我怀疑它与下面的片段(来自上面的文章)有关,但尝试返回字符串会导致“文件过早结束”错误:

<cfif not isAuthorized>
    <!--- If the user does not pass a user name/password, return a 401 error.  
    The browser then prompts the user for a user name/password. ---> 
    <cfheader statuscode="401">
    <cfheader name="WWW-Authenticate" value="Basic realm=""Test"""> 
    <cfabort> 
</cfif>
4

0 回答 0