TdxGoogleAPIOAuth2AuthorizationAgentUserInfo Class
A data provider designed to load user information from a connected Google online account.
#Declaration
TdxGoogleAPIOAuth2AuthorizationAgentUserInfo = class(
TdxOAuth2AuthorizationAgentUserInfo
)
#Remarks
The Google user information provider can obtain general account information (such as a user name or e-mail) from a Google account.
#Main API Members
The list below outlines key members of the TdxGoogleAPIOAuth2AuthorizationAgentUserInfo
class. These members allow you to obtain user information from a Google account.
#Online Service Interaction APIs
- AuthorizationAgent
- Provides access to the parent authorization agent component.
- GetUserInfo
- Creates a new user information provider for the target Google authorization agent component.
- UpdateInfo
- Connects to a Google account through the parent authorization agent and loads user information.
#User Information APIs
- DisplayName
- Returns the display name of the connected account’s owner.
- Returns the e-mail of the connected account’s owner.
#Code Example
The following code example creates a user information provider and uses a configured TdxGoogleAPIOAuth2AuthorizationAgent component to display user information from an online account in the form caption:
The following code example creates a user information provider and uses a configured TdxMicrosoftGraphAPIOAuth2AuthorizationAgent component to display user information from an online account in the form caption:
var
AInfo: TdxAuthorizationAgentUserInfo;
begin
AInfo := TdxAuthorizationAgentUserInfo.GetUserInfo(dxGoogleAPIOAuth2AuthorizationAgent1);
if AInfo = nil then Exit;
try
AInfo.UpdateInfo; // Obtains user information through the authorization agent component
Caption := Caption + Format(' User Name: %s; e-mail: %s', [AInfo.DisplayName, AInfo.Mail]);
finally
AInfo.Free; // Releases the user information provider to avoid memory leaks
end;
end;
#Other Online Service Data Providers
User information providers allow you to retrieve only basic user information from a compatible online service account. The sections below list dedicated online service data provider classes that allow you to synchronize data between an online account and your desktop VCL application.
#Cloud Storage Provider Classes
You can use the following data providers to synchronize data between the TdxCloudStorage component and a cloud storage account.
- TdxCloudStorageGoogleDriveProvider
- An online file provider that can work with the Google Drive file storage service.
- TdxCloudStorageMicrosoftOneDriveProvider
- An online file data provider that can work with Microsoft OneDrive®.
#Online Calendar Provider Classes
You can use the following data providers to synchronize events between the TcxScheduler control and an online calendar.
- TcxSchedulerWebServiceStorageGoogleProvider
- An online event data provider that can work with Google accounts.
- TcxSchedulerWebServiceStorageOfficeProvider
- An online event data provider that can work with Microsoft accounts.