How to use/find a customer's MS Dynamics Dataverse tentant resource?

26 views Asked by At

I am building an OAuth2 Authorization code flow for Microsoft Dynamics 365 (Dataverse), to allow our customers to integrate our product with their Dynamics CRM/Sales data.

Microsoft is using an unusual approach (I think?) to authorize access to the customer's tenant: In the authorization code request a "resource" parameter is included, which is the customer's tenant-specific API URL.

But how do I get that tenant-specific API URL? I'd very much prefer to not have to ask the customer to enter that info. It's a technical detail, which can be hard for some to find.

I have found one suggestion, in a previous Stackoverflow question, but it's not complete:

Get Customer Resource Id with Multi Tenant OAuth on Microsoft Dynamics

Essentially, the suggestion is to first using a different "resource" to get access to an MS Dynamics discovery service, where the customer's API URL can be found.

But now what? As far as I can determine, I must then execute the whole OAuth2 authorization code flow again, this time with the API URL as the resource. That's does not seem to be a very nice experience for the user.

Is this the only way? Does anyone have any suggestions?

Regards

0

There are 0 answers