Files
dify-docs/zh-hans/guides/knowledge-base/knowledge-pipeline/authorize-data-source.mdx
Anne 9c99d0e19c Update DSL Naming Issue in RAG Doc(EN) (#444)
* Add knowledge pipeline page

* Add page knowledge orchestration

* Complete en & zh version for knowledge pipeline

* renew en. version of knowledge pipeline

* Complete Ch and Jp

* Modify styles

* Update create-knowledge-pipeline.mdx

RAG related updates: Change DSL into Pipeline.

* Update create-knowledge-pipeline.mdx

* Update create-knowledge-pipeline.mdx

---------

Co-authored-by: Hanqing Zhao <sherry9277@gmail.com>
2025-09-04 22:06:59 +08:00

98 lines
4.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 数据源授权
---
Dify 支持多种外部数据源的连接为了确保数据安全和访问控制不同的数据源需要进行相应的授权配置。根据数据源的特性Dify 提供两种主要的授权方式:**API Key** 和 **OAuth**,以确保你能够安全地访问和导入所需的数据。
## 数据源授权界面入口
在 Dify 中,你可以通过以下两种方式进入数据源授权配置界面:
### 方式一:通过知识流水线编排界面
进入知识流水线编排界面,添加需要的数据源。选中数据源节点,在右侧面板中,点击**绑定**。
![流水线授权界面](/images/knowledge-base/authorize-data-1.PNG)
### 方式二:设置界面
点击右上角头像,选择**设置**,点击**数据来源**。进入数据来源页面后,选择需要授权的数据源,点击**配置**。
![设置授权界面](/images/knowledge-base/authorize-data-2.PNG)
## 支持数据源及授权方式
| 数据源 | API Key | OAuth |
|-------------|---------|-------|
| Notion | ✅ | ✅ |
| Jina Reader | ✅ | |
| Firecrawl | ✅ | |
| Google Drive| | ✅ |
| Dropbox | ✅ | ✅ |
| OneDrive | | ✅ |
## 授权方式和流程
### API Key 授权
API Key 授权是一种基于密钥的身份验证方式,适用于企业级服务和开发者工具。用户需要在对应的服务提供商处生成 API Key然后在 Dify 中进行配置。
#### 授权流程
1. 在数据源配置界面,选择对应的数据源,点击右侧的**配置**,选择**添加 API Key**。
![添加API Key](/images/knowledge-base/authorize-data-3.PNG)
2. 在弹出的配置面板中,填写对应信息。完成后,点击**保存**完成授权。
![API Key配置](/images/knowledge-base/authorize-data-4.png)
API 密钥将被安全加密储存,配置成功后会显示 **Connected** 状态,你可以在知识流水线中使用该数据源。
![API Key 配置完成](/images/knowledge-base/authorize-data-6.png)
### OAuth 授权
OAuth 是一种开放标准的授权协议允许用户在不暴露密码的情况下授权第三方应用访问其在特定服务提供商上的资源。Dify 提供两种 OAuth 授权配置方式:默认配置和自定义配置。
#### 授权流程
1. 在数据源配置界面,选择对应的数据源,点击右侧的**配置**,选择**添加 OAuth**。
![添加OAuth](/images/knowledge-base/authorize-data-7.png)
2. 在授权页面中查看并确认权限范围后,点击**允许访问**。
<div style={{display: 'flex', flexWrap: 'wrap', gap: '30px'}}>
<div style={{flex: 1, minWidth: '300px'}}>
![OAuth权限确认](/images/knowledge-base/authorize-data-8.png)
</div>
<div style={{flex: 1, minWidth: '300px'}}>
![允许访问](/images/knowledge-base/authorize-data-9.png)
</div>
</div>
#### OAuth 客户端设置
Dify 提供默认和自定义两种 OAuth 客户端配置方式。
![OAuth客户端设置](/images/knowledge-base/authorize-data-10.png)
- **默认客户端**
仅 SaaS 版本支持默认客户端,你可以使用 Dify 官方预配置并维护的 OAuth 客户端参数,在 SaaS 版本一键添加 OAuth 凭据,无需进行额外的配置。
- **自定义客户端**
Dify 所有版本均支持自定义客户端。对于 SaaS 版本中尚未提供的默认配置数据源,你需要前往第三方平台自行注册并获取 OAuth 客户端参数。
**授权流程**
1. 在数据源配置界面,选择对应的数据源,点击右侧的**配置**,选择**添加 OAuth** 右侧的**设置图标**,进入 OAuth 客户端设置。
![自定义OAuth设置](/images/knowledge-base/authorize-data-11.png)
2. 点击**自定义**,输入 **Client ID** 和 **Client Secret**。点击**保存并授权**完成 OAuth 授权流程。
![自定义OAuth配置](/images/knowledge-base/authorize-data-12.png)
{/*
Contributing Section
DO NOT edit this section!
It will be automatically generated by the script.
*/}
---
[编辑此页面](https://github.com/langgenius/dify-docs/edit/main/zh-hans/guides/knowledge-base/knowledge-pipeline/authorize-data-source.mdx) | [报告问题](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)