Del via


ServiceClient.DiscoverOnlineOrganizationsAsync Method

Definition

Overloads

DiscoverOnlineOrganizationsAsync(String, String, String, Uri, Boolean, String, PromptBehavior, Boolean, DiscoveryServer, String, ILogger)

Discovers Organizations Using the global discovery service.

Provides a User ID / Password flow for authentication to the online discovery system. You can also provide the discovery instance you wish to use, or not pass it. If you do not specify a discovery region, the commercial global region is used

DiscoverOnlineOrganizationsAsync(Uri, ClientCredentials, String, Uri, Boolean, String, PromptBehavior, Boolean, String, ILogger)

Discovers the organizations, used for OAuth.

DiscoverOnlineOrganizationsAsync(Func<String,Task<String>>, Uri, String, ILogger, CancellationToken)
DiscoverOnlineOrganizationsAsync(Func<String,Task<String>>, Uri, String, ILogger)

Discovers Organizations Using the global discovery service and an external source for access tokens

DiscoverOnlineOrganizationsAsync(String, String, String, Uri, Boolean, String, PromptBehavior, Boolean, DiscoveryServer, String, ILogger)

Discovers Organizations Using the global discovery service.

Provides a User ID / Password flow for authentication to the online discovery system. You can also provide the discovery instance you wish to use, or not pass it. If you do not specify a discovery region, the commercial global region is used

public static System.Threading.Tasks.Task<Microsoft.PowerPlatform.Dataverse.Client.Model.DiscoverOrganizationsResult> DiscoverOnlineOrganizationsAsync (string userId, string password, string clientId, Uri redirectUri, bool isOnPrem, string authority, Microsoft.PowerPlatform.Dataverse.Client.Auth.PromptBehavior promptBehavior = Microsoft.PowerPlatform.Dataverse.Client.Auth.PromptBehavior.Auto, bool useDefaultCreds = false, Microsoft.PowerPlatform.Dataverse.Client.Model.DiscoveryServer discoServer = default, string tokenCacheStorePath = default, Microsoft.Extensions.Logging.ILogger logger = default);
static member DiscoverOnlineOrganizationsAsync : string * string * string * Uri * bool * string * Microsoft.PowerPlatform.Dataverse.Client.Auth.PromptBehavior * bool * Microsoft.PowerPlatform.Dataverse.Client.Model.DiscoveryServer * string * Microsoft.Extensions.Logging.ILogger -> System.Threading.Tasks.Task<Microsoft.PowerPlatform.Dataverse.Client.Model.DiscoverOrganizationsResult>
Public Shared Function DiscoverOnlineOrganizationsAsync (userId As String, password As String, clientId As String, redirectUri As Uri, isOnPrem As Boolean, authority As String, Optional promptBehavior As PromptBehavior = Microsoft.PowerPlatform.Dataverse.Client.Auth.PromptBehavior.Auto, Optional useDefaultCreds As Boolean = false, Optional discoServer As DiscoveryServer = Nothing, Optional tokenCacheStorePath As String = Nothing, Optional logger As ILogger = Nothing) As Task(Of DiscoverOrganizationsResult)

Parameters

userId
String

User ID to login with

password
String

Password to use to login with

clientId
String

The client Id.

redirectUri
Uri

The redirect uri.

isOnPrem
Boolean

The deployment type: OnPrem or Online.

authority
String

The authority provider for OAuth tokens. Unique if any already known.

promptBehavior
PromptBehavior

The prompt behavior.

useDefaultCreds
Boolean

(Optional) if specified, tries to use the current user

discoServer
DiscoveryServer

(Optional) URI of the discovery server

tokenCacheStorePath
String

(optional) path to log store

logger
ILogger

Logging provider ILogger

Returns

A collection of organizations

Applies to

DiscoverOnlineOrganizationsAsync(Uri, ClientCredentials, String, Uri, Boolean, String, PromptBehavior, Boolean, String, ILogger)

Discovers the organizations, used for OAuth.

public static System.Threading.Tasks.Task<Microsoft.PowerPlatform.Dataverse.Client.Model.DiscoverOrganizationsResult> DiscoverOnlineOrganizationsAsync (Uri discoveryServiceUri, System.ServiceModel.Description.ClientCredentials clientCredentials, string clientId, Uri redirectUri, bool isOnPrem, string authority, Microsoft.PowerPlatform.Dataverse.Client.Auth.PromptBehavior promptBehavior = Microsoft.PowerPlatform.Dataverse.Client.Auth.PromptBehavior.Auto, bool useDefaultCreds = false, string tokenCacheStorePath = default, Microsoft.Extensions.Logging.ILogger logger = default);
static member DiscoverOnlineOrganizationsAsync : Uri * System.ServiceModel.Description.ClientCredentials * string * Uri * bool * string * Microsoft.PowerPlatform.Dataverse.Client.Auth.PromptBehavior * bool * string * Microsoft.Extensions.Logging.ILogger -> System.Threading.Tasks.Task<Microsoft.PowerPlatform.Dataverse.Client.Model.DiscoverOrganizationsResult>
Public Shared Function DiscoverOnlineOrganizationsAsync (discoveryServiceUri As Uri, clientCredentials As ClientCredentials, clientId As String, redirectUri As Uri, isOnPrem As Boolean, authority As String, Optional promptBehavior As PromptBehavior = Microsoft.PowerPlatform.Dataverse.Client.Auth.PromptBehavior.Auto, Optional useDefaultCreds As Boolean = false, Optional tokenCacheStorePath As String = Nothing, Optional logger As ILogger = Nothing) As Task(Of DiscoverOrganizationsResult)

Parameters

discoveryServiceUri
Uri

The discovery service URI.

clientCredentials
ClientCredentials

The client credentials.

clientId
String

The client Id.

redirectUri
Uri

The redirect uri.

isOnPrem
Boolean

The deployment type: OnPrem or Online.

authority
String

The authority provider for OAuth tokens. Unique if any already known.

promptBehavior
PromptBehavior

The prompt behavior.

useDefaultCreds
Boolean

(Optional) if specified, tries to use the current user

tokenCacheStorePath
String

(optional) path to log store

logger
ILogger

Logging provider ILogger

Returns

A collection of organizations

Applies to

DiscoverOnlineOrganizationsAsync(Func<String,Task<String>>, Uri, String, ILogger, CancellationToken)

public static System.Threading.Tasks.Task<Microsoft.Xrm.Sdk.Discovery.OrganizationDetailCollection> DiscoverOnlineOrganizationsAsync (Func<string,System.Threading.Tasks.Task<string>> tokenProviderFunction, Uri discoveryServiceUri = default, string tokenCacheStorePath = default, Microsoft.Extensions.Logging.ILogger logger = default, System.Threading.CancellationToken cancellationToken = default);
static member DiscoverOnlineOrganizationsAsync : Func<string, System.Threading.Tasks.Task<string>> * Uri * string * Microsoft.Extensions.Logging.ILogger * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Xrm.Sdk.Discovery.OrganizationDetailCollection>
Public Shared Function DiscoverOnlineOrganizationsAsync (tokenProviderFunction As Func(Of String, Task(Of String)), Optional discoveryServiceUri As Uri = Nothing, Optional tokenCacheStorePath As String = Nothing, Optional logger As ILogger = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of OrganizationDetailCollection)

Parameters

tokenProviderFunction
Func<String,Task<String>>
discoveryServiceUri
Uri
tokenCacheStorePath
String
logger
ILogger
cancellationToken
CancellationToken

Returns

Applies to

DiscoverOnlineOrganizationsAsync(Func<String,Task<String>>, Uri, String, ILogger)

Discovers Organizations Using the global discovery service and an external source for access tokens

public static System.Threading.Tasks.Task<Microsoft.Xrm.Sdk.Discovery.OrganizationDetailCollection> DiscoverOnlineOrganizationsAsync (Func<string,System.Threading.Tasks.Task<string>> tokenProviderFunction, Uri discoveryServiceUri = default, string tokenCacheStorePath = default, Microsoft.Extensions.Logging.ILogger logger = default);
static member DiscoverOnlineOrganizationsAsync : Func<string, System.Threading.Tasks.Task<string>> * Uri * string * Microsoft.Extensions.Logging.ILogger -> System.Threading.Tasks.Task<Microsoft.Xrm.Sdk.Discovery.OrganizationDetailCollection>
Public Shared Function DiscoverOnlineOrganizationsAsync (tokenProviderFunction As Func(Of String, Task(Of String)), Optional discoveryServiceUri As Uri = Nothing, Optional tokenCacheStorePath As String = Nothing, Optional logger As ILogger = Nothing) As Task(Of OrganizationDetailCollection)

Parameters

tokenProviderFunction
Func<String,Task<String>>

Function that will provide access token to the discovery call.

discoveryServiceUri
Uri

Global discovery base URI to use to connect too, if null will utilize the commercial Global Discovery Server.

tokenCacheStorePath
String

(optional) path to log store

logger
ILogger

Logging provider ILogger

Returns

Applies to