I have searched through all TMS Cloud Pack demos and documentation and I could not find a way to allow my users to use their Google Account to authenticate and sign-in/log-in to my Delphi apps.
Do you have such functionality? If so, is there any sample code to show me how it is done?
As a reference, the “eSeGeCe” components include a specific class and very clear documentation on how to accomplish exactly what I want:
All Google service-based components in TMS FNC Cloud Pack (e.g., TTMSFNCCloudGoogleDrive, TTMSFNCCloudGoogleGMail, etc.) inherit from the TTMSFNCCustomCloudGoogle class. This base class includes a GetUserInfo method that populates the Profile property with user data, allowing you to implement sign-in functionality in your Delphi application.
If your application doesn't require any specific Google service functionality, you can instantiate a TTMSFNCCustomCloudGoogle object in your code and use it to fetch the authenticated user's profile information.
uses
FMX.TMSFNCCloudGoogle,
public
TMSFNCCloudGoogle: TTMSFNCCustomCloudGoogle;
end;
//...
procedure TForm1.FormCreate(Sender: TObject);
begin
TMSFNCCloudGoogle := TTMSFNCCustomCloudGoogle.Create(Self);
TMSFNCCloudGoogle.OnConnected := TMSFNCCloudGoogleConnected;
TMSFNCCloudGoogle.OnGetUserInfo := TMSFNCCloudGoogleGetUserInfo;
TMSFNCCloudGoogle.Authentication.ClientID := 'clientid';
TMSFNCCloudGoogle.Authentication.Secret := 'secret';
TMSFNCCloudGoogle.Authentication.CallBackURL := 'http://localhost:8000';
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
TMSFNCCloudGoogle.Free;
end;
procedure TForm1.TMSFNCCloudGoogleConnected(Sender: TObject);
begin
TMSFNCCloudGoogle.GetUserInfo;
end;
procedure TForm1.TMSFNCCloudGoogleGetUserInfo(Sender: TObject;
const ARequestResult: TTMSFNCCloudBaseRequestResult);
begin
ShowMessage(TMSFNCCloudGoogle.Profile.FullName);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
TMSFNCCloudGoogle.Connect;
end;