GlobalDiscoveryService
- Namespace:
PPDS.Auth.Discovery - Assembly:
PPDS.Auth - Kind: Class
- Implements:
IGlobalDiscoveryService,IDisposable
Summary
Service for discovering Dataverse environments via the Global Discovery Service.
Members
Constructors
GlobalDiscoveryService(CloudEnvironment cloud, string tenantId, string homeAccountId, Nullable<AuthMethod> preferredAuthMethod, Action<DeviceCodeInfo> deviceCodeCallback)
GlobalDiscoveryService(CloudEnvironment cloud, string tenantId, string homeAccountId, Nullable<AuthMethod> preferredAuthMethod, Action<DeviceCodeInfo> deviceCodeCallback)
Creates a new GlobalDiscoveryService.
-
Param
cloud: The cloud environment to use. -
Param
tenantId: Optional tenant ID. -
Param
homeAccountId: Optional MSAL home account identifier for precise account lookup. -
Param
preferredAuthMethod: Optional preferred auth method from profile. -
Param
deviceCodeCallback: Optional callback for device code display.
Methods
DiscoverEnvironmentsAsync
Task<IReadOnlyList<DiscoveredEnvironment>> DiscoverEnvironmentsAsync(CancellationToken cancellationToken)
Discovers all environments accessible to the authenticated user.
-
Param
cancellationToken: Cancellation token. -
Returns: Collection of discovered environments.
Dispose
void Dispose()
(inherited from System.IDisposable.Dispose)
FromProfile
GlobalDiscoveryService FromProfile(AuthProfile profile, Action<DeviceCodeInfo> deviceCodeCallback)
Creates a GlobalDiscoveryService from an auth profile.
-
Param
profile: The auth profile. -
Param
deviceCodeCallback: Optional callback for device code display. -
Returns: A new service instance.
SupportsGlobalDiscovery
bool SupportsGlobalDiscovery(AuthMethod authMethod)
Checks if an authentication method supports Global Discovery.
-
Param
authMethod: The authentication method to check. -
Returns: True if the method can be used with Global Discovery; otherwise false.
Properties
CapturedHomeAccountId
string CapturedHomeAccountId { get; }
Gets the HomeAccountId captured during interactive authentication.