> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Dynamics 365 Query authentication guide

export const maia = "Maia";

This is a step-by-step guide to acquiring Dynamics 365 credentials and authorizing the [Dynamics 365 Query](/docs/components/dynamics-365-query) component.

***

## Prerequisites

Make sure that each Security Role you create or update in Dynamics 365 has at least the User access level and Read privileges. For more information about access levels and privileges, read the [Dynamics 365 documentation](https://learn.microsoft.com/en-us/dynamics365/customerengagement/on-premises/admin/security-roles-privileges).

***

## Create an OAuth connection

1. Follow the instructions in [OAuth](/docs/guides/oauth), and select Dynamics 365 in the **Provider** field. Then, follow the steps below to fill in the fields in the **Values** section of the OAuth creation process.
2. Log in to [Office 365 Home](https://www.office.com/apps).
3. Click **Business Apps**, then **Dynamics 365 - custom**. This will open a Dynamics 365 dashboard. The page's URL will contain your Dynamics 365 organization URL. Copy everything before and including `dynamics.com`. For example, if the URL is `https://companyname.crm11.dynamics.com/main.aspx#414717258`, you will need `https://companyname.crm11.dynamics.com`.
4. Paste this into the **Organization URL** field in {maia}.
5. Select an edition from the drop-down field.
6. Click **Authorize**.
7. A new browser tab will open, connecting you to the third party. Select your account, and complete the connection. If this is the first time you have connected to this third party, you will need to grant Matillion the required permissions. Upon success, this browser tab will close.

Your new OAuth connection is ready for use with the [Dynamics 365 Query](/docs/components/dynamics-365-query) component.
