Developer Al Mannarino from Embarcadero has published a demo on how to implement basic authentication for HTTP in Delphi XE8 Firemonkey. The demo works on Android, IOS, OSX, and Windows. It utilizes the native platform HTTP client component TNetHTTPClient in Delphi XE8. Basic HTTP authentication sends an HTTP header field containing a Base64 encoded user and password. You should use SSL/TLS encryption with your connections if you are using basic HTTP authentication for enhanced security. Unless you are using a session you will need to send the basic HTTP authentication header each time you make an HTTP request. An alternative method is to just POST your username and password via an HTTP request and then set up a session variable which you would pass back to the server on each additional request. You should be able to use this example with Appmethod as well. Here is a code snippet from the demo:
if (eUser.Text <> '') or (ePwd.Text <> '') then
BasicAuth := TNetHeader.Create('Authorization',
'Basic ' + Encode64(eUser.Text + ':' + ePwd.Text));
LResponse := NetHTTPRequest1.Get(eURL.Text);
m1.Text := LResponse.ContentAsString;
on e: Exception do
FMXExpress.com has over 700 tips and tricks for building cross platform apps on Android, IOS, OSX, Windows, and Linux with a single codebase and single UI using the FireMonkey framework found in Delphi and C++Builder.
FMXExpress covers top cross platform secrets for FireMonkey in C++Builder and Delphi XE5, XE6, XE7, XE8, Seattle, Berlin, Tokyo, Rio, and Sydney.