任何方式与德尔福的Websense服务器进行身份验证? [英] Any way to authenticate with a websense server from delphi?

查看:94
本文介绍了任何方式与德尔福的Websense服务器进行身份验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用 Websense的互联网过滤我的工作场所。我有试图从互联网上信息的应用程序。

We use a websense internet filter at my workplace. I have an application that tries to retrieve information from the internet.

在我的客户机上,我有手动与Websense认证(即打开Firefox并给予我的用户名/密码),或者当它试图做的下载,我会在我的应用程序出现错误。

On my client machine, I have to authenticate with websense manually (i.e., open firefox and give my username / password) or I'll get an error in my application when it tries to do the download.

错误消息是:

HTTP/1.0 302 Moved.

有谁知道的方式从code Websense的认证?在任何语言的例子是welcome-我使用Delphi和Indy的TIdHTTP组成部分。

Does anyone know of a way to authenticate with websense from code? Examples in any language are welcome- I am using Delphi and Indy's TIdHTTP component.

推荐答案

回答我的问题;这是为我工作。

Answering my own question; this is what worked for me.

自定义用户代理字符串仅如果您想验证让MSN / Live Messenger的打通,要求截至本文章的结尾的注意事项中所述。

The custom user agent string is only required if you want the authentication to let MSN / Live messenger get through, as described under "notes" at the end of this article.

在一个命令行应用程序:

In a command line application:

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);
...

这篇关于任何方式与德尔福的Websense服务器进行身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆