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

**URL:** <https://community.make.com/t/401-when-trying-to-access-dynamics-through-native-http-oauth-2-module/20403>\
**Category:** Questions\
**Tags:** microsoft-365\
**Created:** [November 27, 2023, 1:50pm UTC](https://community.make.com/t/401-when-trying-to-access-dynamics-through-native-http-oauth-2-module/20403 "2023-11-27T13:50:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bob\_Balm](https://avatars.discourse-cdn.com/v4/letter/b/7ea924/32.png) [@Bob\_Balm](https://community.make.com/u/Bob_Balm)\
**Post date:** [November 27, 2023, 1:50pm UTC](https://community.make.com/t/401-when-trying-to-access-dynamics-through-native-http-oauth-2-module/20403/1 "2023-11-27T13:50:59Z")

</div>

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](http://Make.com) to Microsoft Dynamics 365, but the client has no budget for [Make.com](http://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](http://Make.com)’s documentation on creating an [Azure AD app for OAuth](https://www.make.com/en/help/app/microsoft-dynamics-365-crm), 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](https://www.make.com/en/help/tutorials/how-to-connect-make-to-any-web-service-that-uses-oauth2-authorization) for setting up the HTTP module in a [Make.com](http://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.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/0/8/0814abb7b0d95a990e534639e65c4ccffd006465.png)

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:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/e/d/ed710a0804c69ced0b4e47e4b7d166eaa9c1c800.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/c/2/c21b99426c4c51eb643e202964be6b36d1369201.png)

The additional headers are added based on [Microsoft Dynamics documentation](https://learn.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/gg334391(v=crm.8)), and as far as I can tell, everything should be there. But the result is this:

![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/5/a/5a8d75a14c5dd83794dc53773888082a821aa0a7.png)

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?

---

<div class="post-metadata">

**Author:** ![Jogger\_Meister](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jogger\_Meister](https://community.make.com/u/Jogger_Meister)\
**Post date:** [January 23, 2024, 1:34pm UTC](https://community.make.com/t/401-when-trying-to-access-dynamics-through-native-http-oauth-2-module/20403/2 "2024-01-23T13:34:15Z")

</div>

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](https://www.make.com/en/help/apps/crm-and-sales-tools/microsoft-dynamics-365-crm)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/0/4/044bd2b42440db7c59f67a7b12975fffcfa4106a.png)

---

<div class="post-metadata">

**Author:** ![Bob\_Balm](https://avatars.discourse-cdn.com/v4/letter/b/7ea924/32.png) [@Bob\_Balm](https://community.make.com/u/Bob_Balm)\
**Post date:** [January 23, 2024, 4:40pm UTC](https://community.make.com/t/401-when-trying-to-access-dynamics-through-native-http-oauth-2-module/20403/3 "2024-01-23T16:40:19Z")

</div>

Hey Jogger\_Meister, thanks for the reply 🙂

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](https://crm.dynamics.com/tenantid/scopes/.default)

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

---

<div class="post-metadata">

**Author:** ![Michaela-Inactive](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/michaela-inactive/32/29_2.png) [@Michaela-Inactive](https://community.make.com/u/Michaela-Inactive)\
**Post date:** [January 24, 2024, 7:50am UTC](https://community.make.com/t/401-when-trying-to-access-dynamics-through-native-http-oauth-2-module/20403/4 "2024-01-24T07:50:10Z")

</div>

Heya @Bob_Balm :blob_wave:

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

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 🙏

_FYI: I marked your comment as a solution to keep the community organized and easy to search for answers. ✅_

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [February 16, 2024, 12:46pm UTC](https://community.make.com/t/401-when-trying-to-access-dynamics-through-native-http-oauth-2-module/20403/5 "2024-02-16T12:46:45Z")

</div>


