Each time we would run the registration wizard, we would go through all of the steps to register Delphi and it would report that it was successfully registered. After closing the wizard, we would get the same error message again. Not a good sign.
I ran the registration wizard one more time and selected register by phone and called the number for US support. The support representative was friendly but had no clue for what was happening. The only thing she could was to open a support case. I tried a few more times after completing the call and found out that you could only register 10 times, after that your registration code has been used up. I was somewhat less than thrilled when I found that little gem.
Sometimes the registration information on a machine can become corrupted and cause an endless registration loop. This also happens when the user login name is changed or if a machine is changed to log in to a Domain. The following steps should help to resolve the problem.
This worked for me, but the usual YMMV caveats apply. I added steps 3 and 11. Once you delete the registry.dat file, you will have deleted the cached copy of your serial number and authorization key. By making a copy of them, it becomes one less this to have to lookup. If you already have Delphi 2007 or RAD Studio 2007 installed, these steps will not affect them.
I've just upgraded from Indy 8.# to 9.0.14 with Delphi 6. Everything seems to work fine.I am new to authentication when using the idHTTP component. I presume that the process is as follows:1. Detect authentication method required
2. Populate required fields such as ProxyPassword, ProxyUsername, etc
3. Perform idHTTP.Get command for required webpage.I have seen much confusion, and bug reports on using and Authentication, SSPI, NTLM etc with Indy. Refence follows:
-bin/dnewsweb?cmd=article&group=borland.public.delphi.internet.winsock&item=54082&utag=Does anyone have example code that goes through the above steps successfully? I'm not asking to be spoon fed, however, there seems to be many problems associated with authentication, especially relating to HTTP and proxy servers.Thanks in advance,
Jason.
What authorization are you referring to exactly? If just a username and
password, you can set those before you connect and make the request to the
server. Or you can wait until the OnAuthorization event to trigger.
>> 1. Detect authentication method required
>
>What authorization are you referring to exactly? If just a username and password, you can set those before you connect and make the request to the server. Or you can wait until the OnAuthorization event to trigger.
I'd like my app to test, detect and populate these fields first before performing a idHTTP.Get command.
As my users are schools (I'm giving this software away for free!!) they know nothing about proxy servers and authentication schemes, so I'd like my app to take care of that for them.Is this possible?
Thanks,
Jason.
I assume that you have TIdHTTP configured to connect to a proxy in the first
place? If so, then just set the proxy's username and password before you
call Get(). If you are already doing that, and still getting an error, then
you are probably providing the wrong authentication info for the proxy. In
which case, you should talk to your proxy's admin (if you have one) to find
out what the proxy is actually expecting.
If you are indeed behind a proxy, then you can't detect that ahead of time.
You must populate the values before you can use the TIdHTTP through the
proxy. You will just have to provide a configuration option to your program
that the user can use to specify the appropriate values ahead of time.> As my users are schools ... they know nothing about proxy servers
> and authentication schemesThey have to have SOMEONE available to manage their networking across the
campus. That is the person you need to talk to.
Gambit
>You must populate the values before you can use the TIdHTTP through the proxy. You will just have to provide a configuration option to your program
>that the user can use to specify the appropriate values ahead of time.
You've nailed the crux of my problem. I don't know enough about authentication/proxy and the combinations of settings to code this. I've looked at the IdHTTP component, and from what I can see it has the following properties that "could" be populated for authentication and navigation through a proxy server.1. idHTTP.ProxyParams -> (BasicAuthentication, ProxyPassword, ProxyPort, ProxyServer, ProxyUsername)
2. idHTTP.Request.BasicAuthentication
3. idHTTP.Request.Password
4. idHTTP.Request.ProxyConnection
5. idHTTP.Request.UsernameNot to mention the events such as OnAuthorisation, OnProxyAuthorisation, OnSelectAuthorisation and OnSelectProxyAuthorisation. I have RTFM but the Indy help doesn't have the "Examples" that the VCL help does that would explain/solve my issues.Are you aware of any code examples around that could step me through this?? Please!!???Much appreciated.
Jason.
You don't have to know anything about it. Indy exposes various properties.
Simply provide input fields for those properties, and let the user decide
what to fill in.> 2. idHTTP.Request.BasicAuthentication
> 3. idHTTP.Request.Password
> 5. idHTTP.Request.UsernameThose have nothing to do with proxies. Those are handled by the end HTTP
server itself.
You don't need to worry about any of those if you are using the properties.
The On...Authorization events are triggered if TIdHTTP does not provide
authorization values ahead of time and the server requires them. That would
allow the program to fill them in at that time, possible prompting the user
for any needed values.
What happens in the case that I provide the user with the ability to enter the ProxyParams properties and the proxy is set to Digest Authentication. Is simply setting the ProxyParams.BasicAuthentication := false and populating the other ProxyParams enough? Sorry for the dumb questions...
Yes, but none go into detail regarding other forms of authentication other than basic (ie digest, integrated windows, etc). I presumed I would have to code for each form of Authentication required?Thanks again for your help.
Cheers,
Jason.
Internally, if the server asks for digest, then TIdHTTP will try to use
digest. If needed, it will trigger the OnSelectAuthorization and/or
OnSelectProxyAuthorization event for you to provide the class type for the
authorization scheme (TIdAuthorizationDigest, TIdAuthorizationNTLM, etc) and
the username and password and such for the scheme.
Gambit
>Internally, if the server asks for digest, then TIdHTTP will try to use
>digest. If needed, it will trigger the OnSelectAuthorization and/or
>OnSelectProxyAuthorization event for you to provide the class type for the
>authorization scheme (TIdAuthorizationDigest, TIdAuthorizationNTLM, etc) and
>the username and password and such for the scheme.
In ordert to enable this type of authentication in your application add
IdAuthenticationSSPI to any of the uses caluses in your program.This will enable this type of authentication and HTTP client will
automatically detect this. Digest is not supported.Also you can specify custom type of auhtentication on the different events.
tehre is 2 events for Server and proxy authentication.Also you can specify User name and password and also other authnetication
specific parameters by setting their values to Params property of
Authentication parameter you get.Authentication.Params['Username']
Authentication.Params['Password']Also for NTLM(SSPI) authorization you can specify domain parameterAuthentication.Params['Domain']or if you typecast Authentication object to TIdSSPINTLMAuthentication you
can see it as property.And don't forget to set HttpOptions.hoInProcessAuth becouse without this
authentication is not handled automatically.Doychin
I have tried all this and numerous other combinations and can not get it to
work. The example posting you give says the proxy must be set up a special
way (Authenticate using "Current User" security context) to work but I
cannot expect all our customers to set up their systems in this special way.Theo Carr-Brion
Thank you for posting so quickly, I really appreciate it. Could you tell me whether the following approach is correct issuing an idHTTP.Get command through an MS ISA Proxy using Integrated Windows Authentication (is this the same as NTLM(SSPI))?1. Set HttpOptions.hoInProcessAuth := true;
2. Ensure IdAuthenticationSSPI is in the uses clause of my app.
3. Populate idHTTP.ProxyParams values (do I populate ProxyUserName and ProxyPassword as well?)
4. Set idHTTP.ProxyParams.BasicAuthentication := false;It would really help if you have an example of this in code.Thanks in advance.
Cheers,
Jason.
As far as I can see you forgot to set the variable Handled = True;
That is in the DoProxyAuthorization procedure before the end;You can see in the function TIdCustomHTTP.DoOnAuthorization (idHTTP.pas line
1129)
that the function breaks and returns false if you don't set it. It is
defaulted to False (line 1110).I can tell you also that I have a working program with indy AND proxy
validation, both basic and NTLM authentication.
So, there is hope.Greetings
Henk
> (Authentication as TIdSSPINTLMAuthentication).Domain:='DOMAIN';You are making an assumption that the Authentication is a
TIdSSPINTLMAuthentication instance without actually testing for that
condition first.> fHttpClient.Request.ContentType:='text/xml';Why are you setting the Request.ContentType to XML? You cannot perform
requests with XML, although you can recieve XML as a response.> fHttpClient.DoRequest(hmPost, fServerUrl, fMessageStream,
> fResponseStream);Why are you calling DoRequest() directly? You should be calling Post()
instead: fHttpClient.Post(fServerUrl, fMessageStream, fResponseStream);
Gambit