procedure TForm1.IdHTTPServer1CommandGet(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo); begin if (ARequestInfo.AuthExists = True) and (ARequestInfo.AuthUsername = 'username') and (ArequestInfo.AuthPassword = 'password') then begin // Auth OK // AResponseInfo.ResponseNo := 200; end else begin // Auth NG // AResponseInfo.ResponseNo := 401; AResponseInfo.AuthRealm := 'input username and password' end; end;