Closed nathansom closed 1 year ago
I am unfortunately unable to reproduce your exact error.
I can get Connecting to CRM... Unable to generate TypeScript files: Client could not authenticate. If the application user was just created, it might take a while before it is available.
by providing an invalid secret.
But I am not able to get the internal response from CRM, that begins with Invalid Login Information
From my perspective it seems more likely to be a connection issue than an issue with XrmDefinitelyTyped. Are you able to connect to CRM with your credentials in general (e.g. through XrmToolbox)?
Please note that the ClientSecret
authentication method requires an App Registration in Azure as well as an Application User in CRM. And that is does not support having a username (which your bullet 4 and screenshots indicate you are trying to do). If you intend to authenticate with an actual user, you should be using the authentication method OAuth
.
Thank you for looking into this @skovlund . It was indeed an issue with the connection itself because I was able to connect with the CRM again after two weeks, using the same config as shown above.
Regarding XrmToolbox, I have never had any issues connecting to the CRM. I also developed my own library based on msal-node and that has never encountered any problem with OAuth authentication.
Speaking of OAuth, I was also unable to use OAuth method with XDT for any account outside my workplace's AAD tenant.
Describe the bug I tried connecting to CRM via both ClientSecret and ConnectionString methods and I always got an error mesage
To Reproduce Steps to reproduce the behavior:
Create a project folder
In the project folder, create a file named:
packages.config
. Set this to the content:Note: You can also try installing v6.3.0 but it will show the same error message
Create a JavaScript file/function to execute
execSync
fromchild_process
module. For comand, usenuget install packages.config -OutputDirectory packages
.In
packages\Delegate.XrmDefinitelyTyped.6.2.0\content\XrmDefinitelyTyped\XrmDefinitelyTyped.exe.config
, add the web API URL forurl
, then add mfaAppId, mfaClientSecret, and username:I also tried using a connection string method but it also failed:
execSync
Expected behavior Connection to the environment is successful and TypeScript files get generated
Screenshots
Environment
GET /RetrieveVersion
)Thank you for your help!