I am about to start a project which will run as an ISAPI DLL (SOAP webservice) eventually. When it’s ready, it must support the standard http authentication (user name and password) mechanism.
During development, I’d like to create TWO projects, one will be a standard EXE with built-in webserver to facilitate debugging and the other one will contain the same units but work as an ISAPI.
My question: How do I implement the http authentication in a standalone exe?
If you are using HTTP server, you can implement OnGetDispatchInfo event as
procedure TNewService.RORemoteDataModuleGetDispatchInfo(
const aTransport: IROTransport; const aMessage: IROMessage);
var
l: IROHTTPRequest;
begin
if Supports(aTransport,IROHTTPRequest,l) then begin
if l.UsesAuthentication then begin
//l.AuthUsername
//l.AuthPassword
end
else begin
raise Exception.Create('Authentication required');
end;
end;
end;