Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxAuthorizationAgentUserInfo.DisplayName Property

Returns the display name of the connected account’s owner.

#Declaration

Delphi
property DisplayName: string read;

#Property Value

Type Description
string

The user display name.

This property returns an empty string if the user information provider is not connected to a supported online account.

#Remarks

Use DisplayName and Mail properties to obtain the user display name and e-mail from a connected online account. Call the UpdateInfo procedure to connect the user information provider to an online account through the parent authorization agent and load user information.

#Code Example: Obtain User Information from a Microsoft Account

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;
See Also