---
title: Authorize Data Source
---

Dify supports connections to various external data sources. To ensure data security and access control, different data sources require appropriate authorization configurations. Dify provides two main authorization methods: **API Key** and **OAuth**.

## Accessing Data Source Authorization

In Dify, you can access data source authorization through the following two methods:

### I. Knowledge Pipeline Orchestration
When orchestrating a knowledge pipeline, select the data source node that requires authorization. Click **Connect** on the right panel.

![Knowledge Pipeline Authorization](/images/knowledge-base/authorize-data-1.PNG)

### II. Settings
Click your avatar in the upper right corner and select **Settings**. Navigate to **Data Sources** and find the data source you wish to authorize.

![Settings Authorization](/images/knowledge-base/authorize-data-2.PNG)

## Supported Data Source Authorization

| Data Source     | API Key | OAuth |
|-----------------|---------|-------|
| Notion          | ✅      | ✅    |
| Jina Reader     | ✅      |       |
| Firecrawl       | ✅      |       |
| Google Drive    |         | ✅    |
| Dropbox         |         | ✅    |
| OneDrive        |         | ✅    |

## Authorization Processes

### API Key Authorization
API Key authorization is a key-based authentication method suitable for enterprise-level services and developer tools. You need to generate API Keys from the corresponding service providers and configure them in Dify.

#### Process
1. On the **Data Source** page, navigate to the corresponding data source. Click **Configure** and then **Add API Key**.
   
   ![Add API Key](/images/knowledge-base/authorize-data-3.PNG)

2. In the pop-up window, fill in the **Authorization Name** and **API Key**. Click **Save** to complete the setup.
   
   ![API Key Configuration](/images/knowledge-base/authorize-data-4.png)

The API key will be securely encrypted. Once completed, you can start using the data source (e.g., Jina Reader) for knowledge pipeline orchestration.

![API Key Complete](/images/knowledge-base/authorize-data-6.png)

### OAuth Authorization
OAuth is an open standard authorization protocol that allows users to authorize third-party applications to access their resources on specific service providers without exposing passwords.

#### Process
1. On the **Data Source** page, select an OAuth-supported data source. Click **Configure** and then **Add OAuth**.

   ![Add OAuth](/images/knowledge-base/authorize-data-7.png)

2. Review the permission scope and click **Allow Access**.

<div style={{display: 'flex', flexWrap: 'wrap', gap: '30px'}}>
  <div style={{flex: 1, minWidth: '300px'}}>
   ![OAuth Permissions](/images/knowledge-base/authorize-data-8.png)
  </div>
  <div style={{flex: 1, minWidth: '300px'}}>
   ![OAuth Allow](/images/knowledge-base/authorize-data-9.png)
  </div>
</div>

#### OAuth Client Settings
Dify provides two OAuth client configuration methods: **Default** and **Custom**.

![OAuth Client Settings](/images/knowledge-base/authorize-data-10.png)

<Tabs>
  <Tab title="Default">
    The default client is primarily supported in the SaaS version, using OAuth client parameters that are pre-configured and maintained by Dify. Users can add OAuth credentials with one click without additional configuration.
  </Tab>
  <Tab title="Custom">
    Custom client is supported across all versions of Dify. Users need to register OAuth applications on third-party platforms and obtain client parameters themselves. This is mainly suitable for data sources that don't have default configuration in the SaaS version, or when enterprises have special security compliance requirements.
  </Tab>
</Tabs>

**Process for Custom OAuth**
1. On the **Data Source** page, select an OAuth-supported data source. Click **Configure** and then the **Setting icon** on the right side of **Add OAuth**.

   ![Custom OAuth Settings](/images/knowledge-base/authorize-data-11.png)

2. Choose **Custom**, enter the **Client ID** and **Client Secret**. Click **Save and Authorize** to complete the authorization.

   ![Custom OAuth Configuration](/images/knowledge-base/authorize-data-12.png)

{/*
Contributing Section
DO NOT edit this section!
It will be automatically generated by the script.
*/}

---

[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/knowledge-base/knowledge-pipeline/authorize-data-source.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

