401 when trying to access Dynamics through native HTTP OAuth 2 module

Hi,

I’m trying to troubleshoot a 401 error that I receive, without any further error message. Here’s my situation:

We’re trying to connect Make.com to Microsoft Dynamics 365, but the client has no budget for Make.com enterprise to use the Dynamics premium app. So instead, we figured we can set up a custom HTTP request through OAuth 2.0.

I’ve basically followed Make.com’s documentation on creating an Azure AD app for OAuth, up until step 8 (changing the redirect URI to Make’s default one for OAuth 2.0 instead of the Microsoft Dynamics specific one, and OAuth 2.0 requests for setting up the HTTP module in a Make.com scenario. Following the Dynamics documentation, I’ve added the scope .default, so the connection inherits the Azure AD app’s scopes for the required endpoints.

So far so good, this connection worked and I am able to reauthorize and reverify without issue.

But now I’m setting up a module inside my scenario to create a Lead in Dynamics 365, and when I try to run the module it returns a 401 error. There’s no further message attached, so I have no idea where in the process it’s getting stuck. This is what my module config looks like:


The additional headers are added based on Microsoft Dynamics documentation, and as far as I can tell, everything should be there. But the result is this:

image

Spoke to the integration partner, other than the original authentication they don’t see anything in the logs on their end.

Has anyone tried this before and able to tell me what’s the problem here?

Heya!

From what I know, Microsoft Dynamics CRM is marked as “Premium” or “Tier 3” app in Make, meaning, this app is only supported in their Enterprise plans. There could be something in the authorization in which the HTTP module is limited especially in the authorization flow.

I’ve also checked their knowledge base and I see this part here, maybe this can help?

https://www.make.com/en/help/apps/crm-and-sales-tools/microsoft-dynamics-365-crm

2 Likes

Hey Jogger_Meister, thanks for the reply :slight_smile:

This turned out to be a mistake in how I defined the Scope in the connection. Instead of just .default, I needed to include the full address, for example (this is not the actual URL, I’m just making it up, but you get the idea): https://crm.dynamics.com/tenantid/scopes/.default

That fixed the whole thing and now it’s working swimmingly :slight_smile:

2 Likes

Heya @Bob_Balm :blob_wave:

I just want to quickly say awesome work figuring this one out :clap:

Also thanks a bunch for stepping back in here and letting us know what to problem was and how you eventually overcame it. This is super valuable and can be incredibly helpful to others looking for similar info in the future :pray:

FYI: I marked your comment as a solution to keep the community organized and easy to search for answers. :white_check_mark:

1 Like