Tip #1122: Multiple tokens in cache

Golf balls in a bucket

If you are working with multiple user or app identities (e.g. for testing), and the code uses ADAL, and especially if the application is killed or crashes, you may occasionally get an error: multiple_matching_tokens_detected: The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements (e.g. UserId) Note that it does not […]

Tip #1112: Impersonate Azure AD users

Elvis impersonator

Developers are familiar with the concept of impersonating Dynamics 365 users. It’s easy – all you need to do is to add MSCRMCallerID header to your Web API request, and you’re done (assuming that you have prvActOnBehalfOfAnotherUser privilege). One of the typical scenarios where you’d want to use the impersonation when you have a web […]

Tip #1077: Connect to the right instance

Connect

As Guido “Future Olive Farmer” Preite has discovered, sometimes CrmServiceClient may connect to the wrong instance. Just like that. Dynamics 365 instances now can be backed up and restored at will. The side-effect of this awesomeness is that URLs and unique names may no longer match, leading to the fun times with connections. Here’s the […]

Tip #1066: Discover Azure AD tenant ID with Occam’s razor

Occam's razor

As developers, from time to time we are puzzled by simple questions: How to discover Azure AD tenant ID based on Dynamics 365 organization URL? Under the normal circumstances I would have put my condescending hat on (did I forget to take it off, again?) and say something like “Use AuthenticationParameters.CreateFromResourceUrlAsync method from ADAL, of […]

Tip #1033: Use Fiddler to boost client-side development

Fiddler crab

Today’s tip is from Matt Beard – thank you! And, hey, you can be a guest tipster too – just send your tip to jar@crmtipoftheday.com. As a CRM developer, I regularly run through this exact process step by step when writing WebResources such as HTML or Javascript and I’m sure others do too. Write your […]

Tip #1013: Include attributes that are not there

Hidden figure

New Developer Guide, as it turned out, contains a lot of useful nuggets, little enhancements that make developer’s life much easier. How many times did you need some field values for the use in javascript but didn’t really want to include the fields on the form? Something like lattitude and longitude, for example. Would it […]