Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ codeunit 433 "Azure AD Tenant"
exit(AzureADTenantImpl.GetPreferredLanguage());
end;

/// <summary>
/// Gets the verified domain names registered on the current Microsoft Entra tenant.
/// If the Microsoft Graph API cannot be reached, the error is displayed.
/// </summary>
/// <returns>A list of verified domain names (e.g. "contoso.com", "contoso.onmicrosoft.com").</returns>
/// <error>Cannot retrieve the Microsoft Entra tenant verified domains.</error>
procedure GetVerifiedDomains(): List of [Text]
begin
exit(AzureADTenantImpl.GetVerifiedDomains());
end;

/// <summary>
/// Gets the Power Platform tenant URL.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ codeunit 3705 "Azure AD Tenant Impl."
TenantDomainNameErr: Label 'Failed to retrieve the Microsoft Entra tenant domain name.';
CountryLetterCodeErr: Label 'Failed to retrieve the Microsoft Entra tenant country letter code.';
PreferredLanguageErr: Label 'Failed to retrieve the Microsoft Entra tenant preferred language code.';
VerifiedDomainsErr: Label 'Failed to retrieve the Microsoft Entra tenant verified domains.';

procedure GetAadTenantId(): Text
var
Expand Down Expand Up @@ -62,6 +63,20 @@ codeunit 3705 "Azure AD Tenant Impl."
Error(PreferredLanguageErr);
end;

procedure GetVerifiedDomains() Domains: List of [Text]
var
VerifiedDomain: DotNet VerifiedDomainInfo;
begin
Initialize();
if IsNull(TenantInfo) then
Error(VerifiedDomainsErr);

foreach VerifiedDomain in TenantInfo.VerifiedDomains() do
if not IsNull(VerifiedDomain) then
if VerifiedDomain.Name() <> '' then
Domains.Add(VerifiedDomain.Name());
end;

procedure GetPowerPlatformTenantURL(): Text
var
PowerPlatformApiWrapper: dotnet "PowerPlatformApiWrapper";
Expand Down
4 changes: 4 additions & 0 deletions src/System Application/App/DotNet Aliases/src/dotnet.al
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,10 @@ dotnet
type("Microsoft.Dynamics.Nav.LicensingService.Model.UserInfo"; "UserInfo")
{
}

type("Microsoft.Dynamics.Nav.LicensingService.Model.VerifiedDomainInfo"; "VerifiedDomainInfo")
{
}
}

assembly("Microsoft.Dynamics.Nav.NavUserAccount")
Expand Down
Loading