【问题标题】:Any way to authenticate with a websense server from delphi?有什么方法可以通过 delphi 的 websense 服务器进行身份验证?
【发布时间】:2009-08-04 14:33:48
【问题描述】:

我们在我的工作场所使用websense 互联网过滤器。我有一个尝试从 Internet 检索信息的应用程序。

在我的客户端计算机上,我必须手动使用 websense 进行身份验证(即打开 Firefox 并提供我的用户名/密码),否则我的应用程序尝试下载时会出错。

错误信息是:

HTTP/1.0 302 Moved.

有谁知道通过代码使用 websense 进行身份验证的方法?欢迎使用任何语言的示例——我使用的是 Delphi 和 Indy 的 TIdHTTP 组件。

【问题讨论】:

    标签: delphi authentication


    【解决方案1】:

    回答我自己的问题;这对我有用。

    仅当您希望验证让 MSN / Live messenger 通过时才需要自定义用户代理字符串,as described under "notes" at the end of this article.

    在命令行应用程序中:

    uses
      ... IdHTTP ...;
    
    ...
    var
      httpGetter: TIdHTTP;
    ...    
    httpGetter.Request.Username := username;
    httpGetter.Request.Password := password;
    httpGetter.HandleRedirects := True;
    httpGetter.Request.BasicAuthentication := True;
    
    //custom useragent required to let live messenger work
    httpGetter.Request.UserAgent := 'MSN Explorer/9.0 (MSN 8.0; TmstmpExt)';
    
    httpGetter.Get(url,MS);
    ...
    

    【讨论】:

      【解决方案2】:

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-06-13
        • 1970-01-01
        • 1970-01-01
        • 2011-03-05
        • 2012-02-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多