delegateas/XrmDefinitelyTyped

Unable to connect

pagex opened this issue · 2 comments

pagex commented

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.
ERROR REQUESTING Token FROM THE Authentication context
ERROR REQUESTING Token FROM THE Authentication contextValue cannot be null.
Parameter name: clientIdUnable to connect to CRM: Value cannot be null.
Parameter name: clientId
Value cannot be null.
Parameter name: clientIdUnable to Login to Dynamics CRM
Unable to Login to Dynamics CRM
Connecting to CRM...

version 6.1.0

config:

<add key="method" value="ClientSecret" />
<add key="mfaAppId" value="XXX" />
<add key="mfaClientSecret" value="XXX" />
<add key="url" value="https://XXX-sandbox.crm6.dynamics.com" />

Same client ID works fine when used in XrmToolbox

Run via attached ps1 and from going to bin folder of compiled project and running .exe from there, same result.
I suspect you use Microsoft.IdentityModel.Clients.Activedirectory v 3 while v5 is the latest

I can reproduce your exact error output but only by not correctly including the "mfaAppId" parameter. If the parameter is missing, misspelled og the value is empty string, I get your error. NB: Mistyping the actual guid gives a different error.

Could you please double check that you have added that line correctly to the correct config file and that you are not overwriting it by passing parameters to your script.

You suspect correctly, we use Microsoft.IdentityModel.Clients.Activedirectory v3.19.8, as Microsoft.CrmSdk.XrmTooling.CoreAssembly requires that or newer.

pagex commented

Yep, I had 2 mfaAppId at the top and had value and bottom one did not. Thanks fixed.