I am working on an app where I need to keep talking to some of the Dynamics CRM APIs in background jobs (every several minutes to upload updated content).
Since ADAL authentication with user credentials (app permissions) use flawlessly with CRM APIs, I was under impression that I will get it working with Client Assertion Certificate Credentials as well.
Code looks something like this -
var certCred = new ClientAssertionCertificate(clientId, cert);
var result = await authContext.AcquireTokenAsync("https://<tenant_name>.crm4.dynamics.com/", certCred);
This works and I am able to get the access token. However since these are delegate permissions, I am not able to perform get authorized to access CRM WebAPIs.
I can obviously use service / daemon account to perform background tasks but I wanted to do it more in client assertion certificate way. Has anyone found the solution to scenarios like this? Does CRM WebAPI support delegate permissions?
Is there any other way to do it?