一位特定用户遇到了与我们的身份验证服务器通信的问题。所以我决定向他请求一些诊断信息,主要是通过向我们发送他在与我们的auth服务器(特定地址是https://xxxxxxxx.com/server/authentication.php)交谈时收到的status code
。
标头请求代码包含用于存储有关此会话的信息的Cookie容器, 不 允许重定向(这是故意的):
List<string> headers = new List<string>();
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.CookieContainer = new CookieContainer();
webRequest.AllowAutoRedirect = false;
using (HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse())
{
headers.Add("Status Code: " + (int)webResponse.StatusCode);
headers.Add("Status Desc: " + webResponse.StatusDescription);
foreach (string key in webResponse.Headers.Keys)
{
if (!key.ToString().Equals("Location"))
{
var value = webResponse.Headers[key];
headers.Add(key + ": " + value);
}
}
}
所需的输出应为302 Found
,因为我们会将尝试访问除xxxxxxxx.com
以外的任何内容的用户重定向回主域。
这是用户收到的输出:
根据状态代码文档,<403> Forbidden
表示:
The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead.
由于这是唯一有这个问题的用户,我们知道这不是我们的服务器问题,而且可能与此特定问题在其服务器中的防火墙配置有关。
我想知道在这一点上我能做些什么来帮助这个用户改善这个403
错误?