mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-26 13:18:34 +07:00
* 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>
98 lines
4.3 KiB
Plaintext
98 lines
4.3 KiB
Plaintext
---
|
||
title: 数据源授权
|
||
---
|
||
|
||
Dify 支持多种外部数据源的连接,为了确保数据安全和访问控制,不同的数据源需要进行相应的授权配置。根据数据源的特性,Dify 提供两种主要的授权方式:**API Key** 和 **OAuth**,以确保你能够安全地访问和导入所需的数据。
|
||
|
||
## 数据源授权界面入口
|
||
|
||
在 Dify 中,你可以通过以下两种方式进入数据源授权配置界面:
|
||
|
||
### 方式一:通过知识流水线编排界面
|
||
|
||
进入知识流水线编排界面,添加需要的数据源。选中数据源节点,在右侧面板中,点击**绑定**。
|
||
|
||

|
||
|
||
### 方式二:设置界面
|
||
点击右上角头像,选择**设置**,点击**数据来源**。进入数据来源页面后,选择需要授权的数据源,点击**配置**。
|
||
|
||

|
||
|
||
## 支持数据源及授权方式
|
||
|
||
| 数据源 | API Key | OAuth |
|
||
|-------------|---------|-------|
|
||
| Notion | ✅ | ✅ |
|
||
| Jina Reader | ✅ | |
|
||
| Firecrawl | ✅ | |
|
||
| Google Drive| | ✅ |
|
||
| Dropbox | ✅ | ✅ |
|
||
| OneDrive | | ✅ |
|
||
|
||
## 授权方式和流程
|
||
|
||
### API Key 授权
|
||
API Key 授权是一种基于密钥的身份验证方式,适用于企业级服务和开发者工具。用户需要在对应的服务提供商处生成 API Key,然后在 Dify 中进行配置。
|
||
|
||
#### 授权流程
|
||
1. 在数据源配置界面,选择对应的数据源,点击右侧的**配置**,选择**添加 API Key**。
|
||
|
||

|
||
|
||
2. 在弹出的配置面板中,填写对应信息。完成后,点击**保存**完成授权。
|
||
|
||

|
||
|
||
API 密钥将被安全加密储存,配置成功后会显示 **Connected** 状态,你可以在知识流水线中使用该数据源。
|
||
|
||

|
||
|
||
### OAuth 授权
|
||
OAuth 是一种开放标准的授权协议,允许用户在不暴露密码的情况下,授权第三方应用访问其在特定服务提供商上的资源。Dify 提供两种 OAuth 授权配置方式:默认配置和自定义配置。
|
||
|
||
#### 授权流程
|
||
1. 在数据源配置界面,选择对应的数据源,点击右侧的**配置**,选择**添加 OAuth**。
|
||
|
||

|
||
|
||
2. 在授权页面中查看并确认权限范围后,点击**允许访问**。
|
||
<div style={{display: 'flex', flexWrap: 'wrap', gap: '30px'}}>
|
||
<div style={{flex: 1, minWidth: '300px'}}>
|
||

|
||
</div>
|
||
<div style={{flex: 1, minWidth: '300px'}}>
|
||

|
||
</div>
|
||
</div>
|
||
|
||
#### OAuth 客户端设置
|
||
Dify 提供默认和自定义两种 OAuth 客户端配置方式。
|
||
|
||

|
||
|
||
- **默认客户端**
|
||
仅 SaaS 版本支持默认客户端,你可以使用 Dify 官方预配置并维护的 OAuth 客户端参数,在 SaaS 版本一键添加 OAuth 凭据,无需进行额外的配置。
|
||
|
||
- **自定义客户端**
|
||
Dify 所有版本均支持自定义客户端。对于 SaaS 版本中尚未提供的默认配置数据源,你需要前往第三方平台自行注册并获取 OAuth 客户端参数。
|
||
|
||
**授权流程**
|
||
1. 在数据源配置界面,选择对应的数据源,点击右侧的**配置**,选择**添加 OAuth** 右侧的**设置图标**,进入 OAuth 客户端设置。
|
||
|
||

|
||
|
||
2. 点击**自定义**,输入 **Client ID** 和 **Client Secret**。点击**保存并授权**完成 OAuth 授权流程。
|
||
|
||

|
||
|
||
{/*
|
||
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)
|