Any way to authenticate with websense server from delphi?

We use the websense internet filter at my workplace. I have an application that is trying to extract information from the Internet.

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

Error message:

HTTP/1.0 302 Moved. 

Does anyone know a way to authenticate using websense from code? Examples in any language are welcome - I use the Delphi component and Indy TIdHTTP.

+2
source share
2 answers

Answering my question; this is what worked for me.

The user agent user line is required only if you want authentication to allow MSN / Live Messenger to pass through as described in the "Notes" section 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); ... 
+3
source
+1
source

All Articles