To add basic authentication to you own http server is really simple, you only need to add inside the “onCommandGet” method the authentication check, as in the example shown after the image

Inside the method you can:
if
( ARequestInfo.AuthUsername.ToUpper.Equals('USERNAME'.ToUpper)
and
ARequestInfo.AuthPassword.Equals('PASSWORD')
)
then
begin
AResponseInfo. ResponseNo : = 401;
AResponseInfo. AuthRealm : = 'Autentication required';
exit;
end;
related articles: