[Bug] Using AuthenticationType AD and UseCurrentUserForLogin = true results in ArgumentNullException #339
Labels
Investigating
We are looking into this issue at this time.
On Premises
Issue applies to On Premises version of Dataverse.
How to reproduce
var crmUri = "Some uri"; var uri = new Uri(crmUri"); var options = new ConnectionOptions { AuthenticationType = Microsoft.PowerPlatform.Dataverse.Client.AuthenticationType.AD, UseCurrentUserForLogin = true, ServiceUri = uri }; var serviceClient = new ServiceClient(options);
running script will throw a ArgumentNullException, something along the lines of a value cannot be null.
Going through the code shows that the CreateConnectionStringFromConnectionOptions method in DynamicCrmConstants is the issue. There is no check on the Password field to check if it is null or not causing line 44 to throw the exception.
Correct fix would be to have a null or empty check for username and password as is the case in the OAuth case.
The text was updated successfully, but these errors were encountered: