# Knowledge Base: Confluence (OAuth 2.0 Authentication)

### **Overview**

This guide will help you connect your Confluence content to MangoApps AI assistants using OAuth 2.0 authentication. Once set up, your assistants can draw answers directly from Confluence pages, blogs, and other structured knowledge in real time.

***

### **What You Will Need**

Before starting the setup process, ensure you have the necessary credentials and access to both MangoApps and Atlassian systems:

* Access to your **Atlassian Developer Console**
* **OAuth 2.0 client credentials**, including:
  * **Client ID**
  * **Client Secret**

***

### **Setup in MangoApps**

#### **Step 1: Start the Knowledge Base Setup in MangoApps**

To begin the integration, you will create a new knowledge base entry inside MangoApps AI Studio.

1. Navigate to **Admin Portal > Modules > AI Studio > External KBs > Create a Knowledge Base**.
2. Select **Confluence** as the data source type.
3. Add a **name**, **description**, and enter the **URL** of the Confluence page or space you want to connect.

<figure><img src="/files/rimNvx6Px0fScvagysWo" alt="" width="563"><figcaption></figcaption></figure>

4. Under **Authentication Method**, select **OAuth 2.0 Authentication**.
5. **Copy the Callback URL** provided—this is needed when registering your OAuth app in Atlassian.

<figure><img src="/files/wl02CiBK1JgAAwW9Irvr" alt="" width="563"><figcaption></figcaption></figure>

***

### **Setup in Atlassion**

#### **Step 2: Create an OAuth 2.0 App in Atlassian**

Next, you’ll set up an OAuth 2.0 application in the Atlassian Developer Console to authorize secure access between Confluence and MangoApps.&#x20;

1. Go to the Atlassian Developer Console – My Apps. You can click [this link](https://developer.atlassian.com/console/myapps) to login directly to that page.
2. Click **Create > OAuth 2.0 integration**.

<figure><img src="/files/pVLZDTYw8B7CydcuisEl" alt="" width="563"><figcaption></figcaption></figure>

3. Name your app, agree to the terms, and click **Create**.

<figure><img src="/files/tnYkHuUEwdlLSCnS4g7t" alt="" width="563"><figcaption></figcaption></figure>

4. You will be redirected to the **App Overview** page. From here, click on the **Authorization tab** and click **Add** in the row named **OAuth 2.0 (3LO)**.

<figure><img src="/files/p9eABBc6iVtQTX2yFUaq" alt="" width="563"><figcaption></figcaption></figure>

5. When asked for a **Callback URL**, paste the one you copied from MangoApps.
6. Click **Save changes** to continue.

***

#### **Step 3: Set Required Permissions in Atlassian**

To allow MangoApps to access and read your Confluence content, you need to assign the appropriate scopes and permissions to the OAuth app.

1. Go to the **Permissions** tab in your Atlassian app settings.
2. Under **User identity API**, click **Add** to allow basic user profile access.
3. Under **Confluence API**, click **Add**, then click **Configure**.

<figure><img src="/files/biah7gsWApTB6TNLT4lm" alt="" width="563"><figcaption></figcaption></figure>

4. On the next page, click **Edit Scopes**. Select the row “**Write Confluence content**”, then click **Save**.

<figure><img src="/files/O2Nivw2BI23SCnYPDe1p" alt="" width="563"><figcaption></figcaption></figure>

5. Certain read permissions must be granted for your OAuth 2.0 app to connect to Confluence. Following the same instructions above, enable the permissions for the required scopes listed below.

<figure><img src="/files/xnslHLTsYsdhfaOAHiuq" alt="" width="563"><figcaption></figcaption></figure>

**Required Scopes:**

* `offline_access`
* `read:content:confluence`
* `read:content-details:confluence`
* `read:space-details:confluence`
* `read:audit-log:confluence`
* `read:page:confluence`
* `read:attachment:confluence`
* `read:blogpost:confluence`
* `read:custom-content:confluence`
* `read:comment:confluence`
* `read:template:confluence`
* `read:label:confluence`
* `read:watcher:confluence`
* `read:relation:confluence`
* `read:user:confluence`
* `read:configuration:confluence`
* `read:space:confluence`
* `read:space.property:confluence`
* `read:user.property:confluence`
* `read:space.setting:confluence`
* `read:analytics.content:confluence`
* `read:content.property:confluence`
* `read:content.metadata:confluence`
* `read:inlinetask:confluence`
* `read:task:confluence`
* `read:whiteboard:confluence`
* `read:app-data:confluence`
* `read:folder:confluence`
* `read:embed:confluence`

6. Click **Save** once you have selected all required scopes.

***

#### **Step 4: Retrieve Client ID and Secret**

With the app and permissions in place, you'll now collect your credentials to link MangoApps with Atlassian.

1. Go to the **Settings** tab in the Atlassian app.
2. Scroll down to the **Authentication details** section.
3. Copy your **Client ID** and **Client Secret** for use in MangoApps.

***

### **Finalize Setup in MangoApps**

#### **Step 5:** Return to MangoApps to complete the integration&#x20;

Input the credentials and authorizing access.

1. In the knowledge base setup screen, enter the **Client ID** under **Confluence App Key**.
2. Enter the **Client Secret** under **Confluence App Secret**.
3. Click **Give Access Consent**.
4. A pop-up will appear. In the **Use app on** field, choose your **Atlassian site**.
5. Click **Accept** to authorize the connection.

<figure><img src="/files/Jjtrc8f9DXeByei0Eutn" alt="" width="563"><figcaption></figcaption></figure>

***

#### **Step 6. (Optional) Configure Regex Filters**

If you want to control which content is included or excluded during crawling, you can define regex-based filters.

* **Use exclusion patterns** to skip files like those containing "private":\
  Example: `.*private.*\.pdf`
* **Use inclusion patterns** to restrict crawling to specific types of content.

<figure><img src="/files/RMa8aHMTQRMY4hjKBs8R" alt="" width="563"><figcaption></figcaption></figure>

You can apply filters to:

* **Space** (space key)
* **Page** (title)
* **Blog** (title)
* **Comment** (by parent content)
* **Attachment** (filename)

{% hint style="warning" %}
If both an inclusion and exclusion filter apply, the exclusion takes precedence.
{% endhint %}

***

#### **Step 7. (Optional) Schedule Syncs**

You can choose to keep your knowledge base up-to-date automatically by enabling scheduled syncing.

If disabled, the sync will run only once upon saving.

***

#### **Step 8: Save and Connect**

To finalize everything, save your setup so MangoApps can begin syncing with your Confluence site.

Click **Save**. MangoApps will now begin indexing content from the connected Confluence site and make it available to AI assistants.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guides.mangoapps.com/ai-guide/external-knowledge-bases/knowledge-base-confluence-oauth-2.0-authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
