Ejemplo n.º 1
0
        private static string[] ConfigureScopes(DataverseODataClientOptions options)
        {
            // required token scope for Dataverse Web API is https://<organizationName>.crm.dynamics.com/.default
            var baseUrl = new Uri(options.OrganizationUrl.GetLeftPart(UriPartial.Authority));
            var scope   = new Uri(baseUrl, DefaultScope).AbsoluteUri;

            return(new[] { scope });
        }
Ejemplo n.º 2
0
        private static TokenCredential ConfigureTokenCredential(DataverseODataClientOptions options)
        {
            var userAssignedClientId = options.ManagedIdentityClientId;

            // we have to specify client id when using user-assigned managed identities
            return(string.IsNullOrWhiteSpace(userAssignedClientId)
                ? new DefaultAzureCredential()
                : new DefaultAzureCredential(new DefaultAzureCredentialOptions
            {
                ManagedIdentityClientId = userAssignedClientId
            }));
        }
 public WebApiEndpointProvider(IOptions <DataverseODataClientOptions> options)
 {
     _options = options.Value;
 }