Search code examples
azureazure-active-directorydynamics-crmmicrosoft-dynamics

Is it possible to send user access token from Dynamics 365 online?


We are about to use Dynamics 365 CRM online and we are new in this area.

...User is logged in using SSO.

Now to my questions...

Alternative 1 Our solution architect want us to use a LogicApp, triggered by create/update on the contact entity, to pick up the loggedin users user access token and send it as Authorization header with the call to our onprem rest service.

As far as I can see this is not possible as the LogicApp is running in its own process (kind of as a windows service). Am I wrong?

We have been looking into other different options instead;

Alternative 2 We have been looking at using a Plugin but fails to get hold of the user access token. It is possible, though, to get hold of the application access token but that is not good enough for my client. Is it even possible? If possible, does anyone have an example of how it is done?

Alternative 3 We have been looking at using Javascript to trigger a LogicApp using HTTP request but fails on CORS. Would the user access token magically be sent with the call? Is it even possible? If possible, does anyone have an example of how it is done?

Alternative 4 We have been looking at using JavaScript but fails to get hold of the user access token. Is it even possible to do? If possible, does anyone have an example of how it is done?

We know how to get the user access token in a console application after logging in with SSO. And we know how to get the user access token in an ASPNET MVC application. But now... this is Dynamics 365 CRM online.

We need the user access token because we want the user information to be sent to API.

Are there any other options? We have been looking into this for a week or so...


Solution

  • In case there is anyone else that is looking into picking up the users access token from D365 online to send it along with calls to an onprem rest service I can now confirm that it is not possible (at least not for the moment).

    Also, I have found out that what my customer really want to do is a mix of authentication/authorization and tracing.