Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Using AuthenticationType AD and UseCurrentUserForLogin = true results in ArgumentNullException #339

Open
NAMiedema opened this issue Nov 23, 2022 · 0 comments
Labels
Investigating We are looking into this issue at this time. On Premises Issue applies to On Premises version of Dataverse.

Comments

@NAMiedema
Copy link

NAMiedema commented Nov 23, 2022

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.

@MattB-msft MattB-msft added the Investigating We are looking into this issue at this time. label Nov 29, 2022
@MattB-msft MattB-msft added the On Premises Issue applies to On Premises version of Dataverse. label Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigating We are looking into this issue at this time. On Premises Issue applies to On Premises version of Dataverse.
Projects
None yet
Development

No branches or pull requests

2 participants