🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #2863

Re: IdHTTP authentication question

#2863
From: Remy Lebeau (TeamB)
Date: Thu, 26 Jan 2006 08:06
29 lines
1804 bytes
"Michael Gillen" <michael@gillenconsultinggroup-nospam.com> wrote in message
news:43a829c4@newsgroups.borland.com...

> IdHTTP->Request->BasicAuthentication = true;
> IdHTTP->Request->Username = "admin"; // you can add an edit box to enable
additional users
> IdHTTP->Request->Password = EdtPassword->Text;

Try also resetting the Authentication property:

    if( IdHTTP->Request->Authentication )
        IdHTTP->Request->Authentication->Reset();

Or:

    if( IdHTTP->Request->Authentication )
    {
        delete IdHTTP->Request->Authentication;
        IdHTTP->Request->Authentication = NULL;
    }

Also, rather than waiting for a rejection-related exception to be thrown,
you can use the OnAuthorization event to dynamically change the username
and/or password.  If you set the Handled parameter to True, then TIdHTTP
will automatically retry to login with the new values.


Gambit
Technical Details
Message-ID: <43d882a7$3@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <43a1e28d$1@newsgroups.borland.com> <43a829c4@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,64f3cf05ca4f04e6
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <43a1e28d$1@newsgroups.borland.com> <43a829c4@newsgroups.borland.com>
Subject: Re: IdHTTP authentication question
Date: Thu, 26 Jan 2006 00:06:55 -0800
Lines: 31
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <43d882a7$3@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1138262695 68.69.17.41 (26 Jan 2006 00:04:55 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail