【问题标题】:Authentication using Server Variable使用服务器变量进行身份验证
【发布时间】:2012-07-31 12:10:46
【问题描述】:

有一个asp.net网站,其中认证如下。该网站的链接将从门户访问。使用 cleartrust,将设置服务器变量。这样的服务器变量之一是“UserID”。

在主页中,使用以下逻辑。它检索服务器变量“UserID”。如果它返回一个非空值,它被认为是经过身份验证的。

我需要证明上述方法是不够的。这意味着,当其他人通过设置服务器变量向网站 url 发出请求时,他们可以看到数据。我想创建另一个网站,通过设置服务器变量来调用当前网站。有可能吗?

    protected void Page_Load(object sender, EventArgs e)
    {

        string user = getCtHeader(this.Request, "UserID").Trim();

    }

    public static string getCtHeader(HttpRequest request, string key)
    {
        string value = request.ServerVariables[key];
        return value;
    }
}

【问题讨论】:

  • 您可以尝试使用WebRequest从另一个站点加载认证页面,调用GetResponse()方法
  • 你是在试图证明这个系统容易受到会话固定的影响吗?

标签: c# asp.net iis


【解决方案1】:

C# WebClient login to accounts.google.com 这样写,只需更改标题,从服务器接收数据即可

【讨论】:

    猜你喜欢
    • 2012-09-06
    • 2010-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-05
    • 2021-12-22
    • 2019-01-28
    相关资源
    最近更新 更多