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

# 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**.

## Access 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.

<Frame>
  <img src="https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/knowledge/authorize-data-01.png?fit=max&auto=format&n=Z6MqdkI3dck9_1H6&q=85&s=c19bf9f7537a7363d793e5706816d49d" alt="Knowledge Pipeline Authorization" width="1280" height="435" data-path="images/use-dify/knowledge/authorize-data-01.png" />
</Frame>

### 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.

<Frame>
  <img src="https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/knowledge/authorize-data-02.png?fit=max&auto=format&n=Z6MqdkI3dck9_1H6&q=85&s=ec659ef29709dbe68c49c797a9bf1a72" alt="Settings Authorization" width="1280" height="619" data-path="images/use-dify/knowledge/authorize-data-02.png" />
</Frame>

## 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**.

   <Frame>
     <img src="https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/knowledge/authorize-data-03.png?fit=max&auto=format&n=Z6MqdkI3dck9_1H6&q=85&s=ada63e7d55f3864e9e3af205d2692011" alt="Add API Key" width="1381" height="256" data-path="images/use-dify/knowledge/authorize-data-03.png" />
   </Frame>

2. In the pop-up window, fill in the **Authorization Name** and **API Key**. Click **Save** to complete the setup.

   <Frame>
     <img src="https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/knowledge/authorize-data-04.png?fit=max&auto=format&n=Z6MqdkI3dck9_1H6&q=85&s=0d9c629735cd5b1a0a10dde81c55c09d" alt="API Key Configuration" width="1280" height="720" data-path="images/use-dify/knowledge/authorize-data-04.png" />
   </Frame>

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

<Frame>
  <img src="https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/knowledge/authorize-data-06.png?fit=max&auto=format&n=Z6MqdkI3dck9_1H6&q=85&s=7a49a319a91a410a6f6505425d866eec" alt="API Key Complete" width="1328" height="256" data-path="images/use-dify/knowledge/authorize-data-06.png" />
</Frame>

### 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**.

   <Frame>
     <img src="https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/knowledge/authorize-data-07.png?fit=max&auto=format&n=Z6MqdkI3dck9_1H6&q=85&s=adc2d46248aa0394de4d9ec08a01f58a" alt="Add OAuth" width="1280" height="305" data-path="images/use-dify/knowledge/authorize-data-07.png" />
   </Frame>

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

<div style={{display: 'flex', flexWrap: 'wrap', gap: '30px'}}>
  <div style={{flex: 1, minWidth: '300px'}}>
    <Frame>
      <img src="https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/knowledge/authorize-data-08.png?fit=max&auto=format&n=Z6MqdkI3dck9_1H6&q=85&s=be67ac72f8a2a9e991437b939e63ef41" alt="OAuth Permissions" width="1242" height="1242" data-path="images/use-dify/knowledge/authorize-data-08.png" />
    </Frame>
  </div>

  <div style={{flex: 1, minWidth: '300px'}}>
    <Frame>
      <img src="https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/knowledge/authorize-data-09.png?fit=max&auto=format&n=Z6MqdkI3dck9_1H6&q=85&s=7b9805813e8edff95cbb4e5c97fa54ef" alt="OAuth Allow" width="1280" height="1280" data-path="images/use-dify/knowledge/authorize-data-09.png" />
    </Frame>
  </div>
</div>

#### OAuth Client Settings

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

<Frame>
  <img src="https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/knowledge/authorize-data-10.png?fit=max&auto=format&n=Z6MqdkI3dck9_1H6&q=85&s=d5f4b1bbdd476c49cb235ea256f3ac2e" alt="OAuth Client Settings" width="1034" height="580" data-path="images/use-dify/knowledge/authorize-data-10.png" />
</Frame>

<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**.

   <Frame>
     <img src="https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/knowledge/authorize-data-11.png?fit=max&auto=format&n=Z6MqdkI3dck9_1H6&q=85&s=d7abb76433023e242ee69d8696a7ed56" alt="Custom OAuth Settings" width="1280" height="364" data-path="images/use-dify/knowledge/authorize-data-11.png" />
   </Frame>

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

   <Frame>
     <img src="https://mintcdn.com/dify-6c0370d8/Z6MqdkI3dck9_1H6/images/use-dify/knowledge/authorize-data-12.png?fit=max&auto=format&n=Z6MqdkI3dck9_1H6&q=85&s=5200273921fcc60f99491a640471246a" alt="Custom OAuth Configuration" width="1198" height="1240" data-path="images/use-dify/knowledge/authorize-data-12.png" />
   </Frame>
