How open a url with http authentication in Delphi?

celsowm picture celsowm · Oct 7, 2011 · Viewed 10.1k times · Source

How open a url (a browser window) that need "http authentication" passing login and password in a transparent way? The legacy app in delphi need open a report in ".aspx" from Reporting Services.

Thanks, Celso

Answer

Darian Miller picture Darian Miller · Oct 7, 2011

Use the Indy TidHTTP component as it can easily handle the authentication requirements. Drop the component on the form and:

IdHTTP1.Request.UserName := 'xxx';
IdHTTP1.Request.Password := 'xxx';
IdHTTP1.Get(x);

I believe that works for whatever Indy version that you might have.