vcl-dxauthorizationagents-8cb36e00.md
The base class for user information providers.
TdxAuthorizationAgentUserInfo = class abstract(TcxIUnknownObject)
A user information provider is designed to obtain general account information (such as user name or e-mail) from an online service.
The list below outlines key members of the TdxAuthorizationAgentUserInfo class. These members allow you to obtain user information from an online service account.
AuthorizationAgentProvides access to the parent authorization agent component.GetUserInfoCreates a new user information provider for the target authorization agent component.UpdateInfoConnects to an online service account through the parent authorization agent and loads user information.
DisplayNameReturns the display name of the connected account’s owner.MailReturns the e-mail of the connected account’s owner.
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(dxMicrosoftGraphAPIOAuth2AuthorizationAgent1);
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;
TdxAuthorizationAgentUserInfo* AInfo;
AInfo = TdxAuthorizationAgentUserInfo::GetUserInfo(dxMicrosoftGraphAPIOAuth2AuthorizationAgent1);
if(AInfo == nullptr) { return; }
try
{
AInfo->UpdateInfo(); // Obtains user information through the authorization agent component
Caption = Caption + " User Name: ";
Caption = Caption + AInfo->DisplayName;
Caption = Caption + "; e-mail: ";
Caption = Caption + AInfo->Mail;
}
__finally
{
delete AInfo; // Releases the user information provider to avoid memory leaks
}
Do not use the TdxAuthorizationAgentUserInfo class directly. Use the following descendants instead:
TdxGoogleAPIOAuth2AuthorizationAgentUserInfoA data provider designed to load user information from a connected Google online account.TdxMicrosoftGraphAPIOAuth2AuthorizationAgentUserInfoA data provider designed to load user information from a connected Microsoft online account.
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.
You can use the following data providers to synchronize data between the TdxCloudStorage component and a cloud storage account.
TdxCloudStorageGoogleDriveProviderAn online file provider that can work with the Google Drive file storage service.TdxCloudStorageMicrosoftOneDriveProviderAn online file data provider that can work with Microsoft OneDrive®.
You can use the following data providers to synchronize events between the TcxScheduler control and an online calendar.
TcxSchedulerWebServiceStorageGoogleProviderAn online event data provider that can work with Google accounts.TcxSchedulerWebServiceStorageOfficeProviderAn online event data provider that can work with Microsoft accounts.
TObject TcxIUnknownObject TdxAuthorizationAgentUserInfo
See Also
TdxOAuth2AuthorizationAgentUserInfo Class