# Prepare Your Microsoft OneNote Unstructured Connection

## Before You Begin

To connect Microsoft OneNote to Data 360, you must first configure a Microsoft Azure application to facilitate authentication.

- **Configure a Microsoft Azure app:** Register a new application (for example, `OneNote integration`) in the Azure portal.
- **Gather credentials:** Make a note of your **Client ID** (Application ID) and **Client Secret**.
- **Gather endpoint URLs:** Obtain the **OAuth 2.0 authorization endpoint (v2)** and **OAuth 2.0 token endpoint (v2)** URLs from your Azure app endpoints.
- **Allowlist the callback URL:** Allowlist the Salesforce callback URL in your Azure app for OAuth browser authentication. You retrieve this exact URL after setting up the auth provider in Salesforce.

## Step 1 - Set Up an Auth Provider in Salesforce

Establish the authentication provider to connect Salesforce with your Azure app.

1. In Salesforce Setup, navigate to **Auth. Providers**.
2. Click **New** and select **Open ID Connect** as the Provider Type.
3. Enter a name for the provider (for example, `OneNoteOIDC`).
4. Input your Azure **Client ID** into the **Consumer Key** field.
5. Input your Azure **Client Secret** into the **Consumer Secret** field.
6. Paste the Azure authorization endpoint into the **Authorize Endpoint URL** field.
7. Paste the Azure token endpoint into the **Token Endpoint URL** field.
8. Click **Save**.
9. Note the **Callback URL** generated at the bottom of the saved Auth Provider page. Add this URL to your Azure app's callback configurations.

## Step 2 - Configure Named Credentials

Configure an external credential, a principal, and a standard named credential to manage the authentication flow.

### 1. Create the External Credential

1. In Setup, navigate to **Named Credentials** and select the **External Credentials** tab.
2. Click **New**.
3. Enter a label and name (for example, `OneNoteEC`).
4. Select **OAuth 2.0** as the Authentication Protocol.
5. Select **Browser Flow** as the Authentication Flow Type.
6. Leave the **Scope** field empty for now.
7. Select the **Auth Provider** you created in the previous section as the Identity Provider.
8. Click **Save**.

### 2. Create the Principal

1. On the saved External Credential page, scroll down to the **Principals** section and click **New**.
2. Enter a parameter name (for example, `OneNotePrincipal`) and assign a sequence number.
3. Select **Named Principal** as the Identity Type.
4. In the **Scope** field, enter exactly: `offline_access https://graph.microsoft.com/.default`
5. Click **Save**.
6. Under the Principals list, click the **Actions** dropdown for your new principal and select **Authenticate**.
7. Follow the Microsoft login prompts to grant access and confirm. A **Success!** message indicates the credentials are authenticated and ready to use.

### 3. Create the Named Credential

1. Navigate back to the main **Named Credentials** tab and click **New**.
2. Enter a label and name (for example, `OneNoteNC`).
3. Enter the exact URL: `https://graph.microsoft.com/v1.0/groups`
4. Select the **External Credential** you just created from the dropdown menu.
5. Click **Save**.

## Next Step

- [Set Up a Microsoft OneNote Unstructured Connection](/docs/data/data-cloud-int/guide/c360-a-set-up-microsoftonenote-connection.md)
