microsoft / PowerPlatform-DataverseServiceClient

Code Replica for Microsoft.PowerPlatform.Dataverse.Client and supporting nuget packages.
MIT License
277 stars 50 forks source link

Using CdsServiceClient with connection string, on prem, IFD #17

Closed larrywelch closed 4 years ago

larrywelch commented 4 years ago

I'm attempting to use the CdsServiceClient. I'm providing a connection string. I get a client but the IsReady is always false. There is no information in the client object telling what is wrong.

Here's my connection string (parameter details are represented with xxxx): Url = https://xxxxxx.com/xxxxxx; Domain = xxxxxx; AuthType = IFD; UserName = xxx.xxx@xxxxxx.com; Password = XXXXXX; RequireNewInstance = True

Any help will be greatly appreciated!

MattB-msft commented 4 years ago

@larrywelch WS-TRUST based flows are not supported going foward in this lib. In the ReadMe on the first page:

In the case of IFD, if your on ADFS from Windows 2016+ you can enabled OAuth and register a client ID to be used for user flows and Application flows.

Regarding the authflow your trying here, That is a noninteractive userpassword flow, that wont be supported by the lib going forward based on the overall direction the auth stack's are taking in Microsoft.

The preferred way that you would do that going forward would be to use a Service Principal, registered in ADFS, with client secret or certificate auth.

Please take a look here too: Deprecation of Office365 authentication type and OrganizationServiceProxy class for connecting to Common Data Service

if you need to continue to use UserID / Password Noninteractive flows, you can stay with CrmServiceClient for a while yet.

thanks