# Knowledge Base: SharePoint

### Overview

Connecting SharePoint as a knowledge base helps your AI assistant provide accurate, real-time answers by referencing documents, pages, and files already maintained in your organization’s SharePoint environment. This integration is particularly useful for centralizing enterprise knowledge and improving AI responsiveness across various user queries.

To complete this setup, you will:

* Register and configure an application in Microsoft Entra ID
* Grant the necessary permissions for SharePoint access
* Enter your credentials into MangoApps AI Studio

***

### What You Will Need

Before you begin, make sure you have the following details and credentials:

* **SharePoint administrator login credentials**
* **Your SharePoint site URL**\
  Example: `https://yourdomain.sharepoint.com/sites/mysite`
* **Microsoft Entra ID login credentials**
* **Client authentication credentials**, including:
  * Domain Name
  * Tenant ID
  * Application Client ID
  * Application Secret Key

{% hint style="danger" %}
You may need to disable Security Defaults and Multi-Factor Authentication (MFA) in your Microsoft Entra Portal for a successful connection. For more information on managing security default settings in the Entra Portal, see [Microsoft’s documentation on how to enable/disable security defaults](https://learn.microsoft.com/en-us/microsoft-365/business-premium/m365bp-conditional-access?view=o365-worldwide\&tabs=secdefaults#security-defaults-1).&#x20;
{% endhint %}

***

### Microsoft Entra ID Setup

To securely connect SharePoint to MangoApps, you’ll first need to register an application in Microsoft Entra ID. This step creates the credentials your AI assistant will use to access SharePoint content—follow the steps below to complete the registration and collect the necessary IDs.

#### Step 1: Register Your Application in Microsoft Entra ID

To enable secure access to SharePoint, you need to register a new application in Microsoft Entra ID.

Sign in to the [Microsoft Entra ID admin center](https://entra.microsoft.com) and navigate to: **Applications > App registrations > New registration**.&#x20;

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2F8IVgFg68e1pKl1FHgpc6%2Fwaefw.png?alt=media&#x26;token=5e6c8d8b-240b-4d15-a867-04631e8d2308" alt="" width="563"><figcaption></figcaption></figure>

Enter a name for your application. Under **Supported account types**, select:\
**Accounts in this organizational directory only**.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FGDKwprY8ZWkvHVUixWeR%2Ffgjty.png?alt=media&#x26;token=392ce2eb-7039-4418-863d-2db0bf1533b5" alt="" width="563"><figcaption></figcaption></figure>

Click the **Register** button.&#x20;

On the **Overview** tab, take note of the:

* **Application (client) ID**
* **Directory (tenant) ID**

These values will be used later when setting up the MangoApps knowledge base.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FalfcgX9ONIRjfCnuNxEs%2Fsethwretwser.png?alt=media&#x26;token=9960a54e-dcbb-45b3-b102-df0eb4be5505" alt="" width="563"><figcaption></figcaption></figure>

***

#### Step 2: Configure Authentication

Next, define how your application will authenticate with SharePoint.

From your application's page, go to **Authentication** under the **Manage** menu.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2Fn7yykQ47rgJO34VGRpoB%2Faeghaerheewqq.png?alt=media&#x26;token=e996bfc6-ba93-48ab-bce0-f80b95b580b2" alt="" width="563"><figcaption></figcaption></figure>

Under **Advanced settings**, set:

* **Allow public client flows** to `No` for confidential client apps (recommended).
* Set to `Yes` **only** if using mobile or JavaScript-based tools. A certificate or secret is not required for public client applications.

*(Optional)* If needed, click **Add a platform** to configure a redirect URL for specific tools.

***

#### Step 3: Certificates & Secrets

You will now create a client secret that will allow MangoApps to authenticate securely.

Navigate to **Certificates & secrets** under the **Manage** menu. Click **New client secret**.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FInqx2ZcGQakwucnajWBE%2Fertyrtyit.png?alt=media&#x26;token=85d13ddf-43d5-4550-b648-a6fc3b27296f" alt="" width="563"><figcaption></figcaption></figure>

Provide a description and select an expiration date.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FbL3rKK6gtcJkBuohpQSw%2Fntrdenrere.png?alt=media&#x26;token=c89d6685-27c8-4c4c-acb8-4d8187ca771e" alt="" width="563"><figcaption></figcaption></figure>

After creation, <mark style="color:red;">**copy and securely store the Secret Value**</mark> <mark style="color:red;"></mark><mark style="color:red;">—</mark> <mark style="color:red;"></mark><mark style="color:red;">**you won’t be able to view it again**</mark><mark style="color:red;">.</mark>

***

#### Step 4: Add API Permissions

These permissions allow your app to read data from SharePoint.

Navigate to **API permissions** under the **Manage** menu and click **Add a permission**.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FttYLUGK1e5nu7OpIkpld%2Fbnvfghdsf.png?alt=media&#x26;token=86e981f2-b8e0-4fe9-b110-a96be0ada12f" alt="" width="563"><figcaption></figcaption></figure>

Select **Microsoft Graph > Delegated permissions**

Enable the following **Microsoft Graph** permissions:

<table data-header-hidden><thead><tr><th></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Application Type</strong></td><td><p></p><ul><li>BrowseSiteLists.ReadWrite.All</li><li>Files.ReadWrite.All</li><li>Sites.FullControl.All</li></ul></td><td></td></tr><tr><td><strong>Delegated Type</strong></td><td><p></p><ul><li>GroupMember.Read.All</li><li>Sites.FullControl.All</li><li>User.Read</li><li>User.Read.All</li></ul></td><td></td></tr></tbody></table>

Next, enable the following **SharePoint** permissions:

<table data-header-hidden><thead><tr><th></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Application Type</strong></td><td><p></p><ul><li>Sites.FullControl.All</li><li>Sites.Manage.All</li><li>Sites.Read.All</li><li>Sites.ReadWrite.All</li><li>Sites.Selected</li></ul></td><td></td></tr><tr><td><strong>Delegated Type</strong></td><td><p></p><ul><li>AllSites.Read</li></ul></td><td></td></tr></tbody></table>

Once configured, click **Grant admin consent** for your domain.

***

### MangoApps Setup

Now that your application is registered and permissions are in place, configure MangoApps to use SharePoint as a knowledge base.

#### Step 5: Add SharePoint as a Knowledge Base Source

Navigate to **Admin Portal > Modules > AI Studio > External KBs**. Click the **Create a knowledge base** button located in the top right of your screen.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FkxhOW4V0ntIsXHmzLz0I%2F02-05-2025-01-42-43.png?alt=media&#x26;token=53a8c94f-479b-4212-b5e8-d5be84e6a8bc" alt="" width="563"><figcaption></figcaption></figure>

Select **SharePoint** as your data source to access the SharePoint Knowledge Base configurations.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FWTeIJu62yJkx97Q6pRKD%2F02-05-2025-01-57-56.png?alt=media&#x26;token=bb0f51f4-af74-4842-bcad-baef230e8ad7" alt="" width="563"><figcaption></figcaption></figure>

In this new menu, fill in the following information in the Configure Knowledge Base section:

* **Name and Description** for the Knowledge Base
* **SharePoint Site URL(s)** to include in the crawl
* **Your SharePoint domain name**

***

#### Step 6: Enter Connector Authentication Credentials

Now we will fill out the information in the Source Authentication section. Start by entering the SharePoint **Directory (tenant) ID** from Step 1 of setup.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FKnZGfU4xmn6NqEygRT15%2F02-05-2025-02-02-48.png?alt=media&#x26;token=54ed6ee8-bc19-4b1e-9898-fa8ba214d1eb" alt="" width="563"><figcaption></figcaption></figure>

In the Connector Authentication Credentials section, enter the following 4 rows of credentials:

| Key            | Value                                          |
| -------------- | ---------------------------------------------- |
| `username`     | Your Microsoft Entra ID email                  |
| `password`     | Your Microsoft Entra ID password               |
| `clientID`     | Application (client) ID from Step 1            |
| `clientSecret` | Secret Value generated in Step 3 of this setup |

***

#### Step 7: (Optional) Add Regex Filters

You can filter the SharePoint content using inclusion/exclusion rules in order to crawl specific SharePoint document metadata via Regex Filters.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FuztZVc26nMs03yWEveqd%2F02-05-2025-02-11-00.png?alt=media&#x26;token=6b7cfc6b-5b1b-4604-b259-d5d57d2c3729" alt="" width="563"><figcaption></figcaption></figure>

Inclusion/exclusion filters can be applied to the following content types:

* Page: Main page title
* Event: Event name
* File: File name with its extension for attachments and all document files

For example, you can use an **exclusion prefix** or regular expression pattern to skip crawling files that include the word “private” in their file names. Similarly, you can use an **inclusion prefix** or **regular expression pattern** to ensure specific content entities or content types are included.

If a document matches both an inclusion and an exclusion filter, the exclusion filter takes priority, and the document will not be crawled.

To exclude PDF files that contain “private” in the file name, you can use the following regular expression pattern:\
`.*private.*\.pdf`

{% hint style="danger" %}
**OneNote** documents are **not** supported.
{% endhint %}

***

#### Step 8: (Optional) Set a Sync Schedule

* If enabled, the knowledge base will auto-sync with SharePoint at regular intervals.
* If toggled off, data will only sync once when you click **Save**.

***

#### Step 9: Save Your Setup

Click **Save**. MangoApps will now initiate the connection and begin crawling your SharePoint content.

The Knowledge base has been successfully connected!
