> For the complete documentation index, see [llms.txt](https://docs.verge.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verge.io/knowledge-base/zh/system-administration/setting-up-vergeos-as-identity-provider-oidc.md).

# 将 VergeOS 作为带 OIDC 的身份提供商进行设置

## 概述

{% hint style="info" %}
**要点**

* 创建一个 OIDC 应用程序，将 VergeOS 设为身份提供者
* 为其他 VergeOS 系统和租户启用单点登录
* 使用第三方提供商配置集中身份验证
* 通过单一 OIDC 配置支持多个客户端系统
  {% endhint %}

本指南将引导您完成使用 OpenID Connect（OIDC）将 VergeOS 配置为身份提供者的过程，从而为多个 VergeOS 系统和租户提供集中身份验证。

## 前提条件

* 对 VergeOS 系统的管理访问权限
* 已在 VergeOS 系统上安装有效的 SSL 证书
* 对 OIDC 概念的基本了解
* 将使用此身份验证的客户端系统 URL

## 创建 OIDC 应用程序的步骤

1. **访问 OIDC 设置**
   * 导航到 **系统** > **OIDC 应用程序** 从顶部菜单中
   * 点击 **新建**
2. **配置基本设置**
   * 输入一个描述性的 **名称** 用于该应用程序
   * 检查 **已启用** 框
   * 添加一个可选的 **说明**
3. **设置重定向 URI**
   * 输入用户在身份验证后将被重定向到的回调 URL
   * 格式： `https://your-system-name.example.com`
   * 可为不同的客户端系统添加多个 URI

{% hint style="success" %}
**使用通配符**

您可以在重定向 URI 中使用通配符：

* 适用于多个系统： `https://examplecorp-site*.example.com`
* 适用于多个子域： `https://vergesystem.*.example.com`
  {% endhint %}

4. **配置身份验证选项**
   * **强制授权来源**：可选择一个第三方提供商
   * **映射用户**：选择是否应将所有已验证用户映射到特定账户
   * 设置 **作用域设置** （个人资料、电子邮件、组）
   * 如有需要，可配置访问限制
5. **保存配置**
   * 点击 **提交** 以创建 OIDC 应用程序
   * 系统将生成客户端 ID 和密钥

## 检索客户端凭据

1. **访问应用程序仪表板**
   * 导航到 **系统 > OIDC 应用程序**
   * 双击您的 OIDC 应用程序
2. **复制所需信息**
   * **Client ID**：使用显示的值或复制图标复制
   * **Client Secret**：使用复制图标（值已隐藏）
   * **Well-Known 配置 URL**：复制显示的 URL

## 最佳实践

* 为不同的客户端组创建单独的 OIDC 应用程序
* 定期审查并更新访问限制
* 在可能的情况下，使用特定的重定向 URI，而不是通配符
* 记录每个 OIDC 应用程序正在使用的系统

## 故障排除

{% hint style="warning" %}
**常见问题**

* **身份验证失败**
  * 验证 SSL 证书是否有效且未过期
  * 检查重定向 URI 是否完全匹配
  * 确保客户端 ID 和密钥已正确复制
* **作用域访问被拒绝**
  * 验证所需的作用域已启用
  * 检查限制设置中的用户权限
* **重定向问题**
  * 确认 URL 格式与重定向 URI 一致
  * 如有使用，请验证通配符模式
  * 检查 SSL 证书问题
    {% endhint %}

## 其他资源

* [将 VergeOS 配置为 OIDC 客户端](/knowledge-base/zh/system-administration/configuring-vergeos-as-oidc-client.md)
* [第三方授权来源](/run-the-platform/authentication/auth-sources-general.md)
* [SSL 证书管理](/run-the-platform/system-administration/certificates.md)

## 反馈

{% hint style="info" %}
**需要帮助吗？**

如果您在设置 OIDC 时遇到任何问题，或对该过程有任何疑问，请随时联系我们的支持团队。
{% endhint %}

***

{% hint style="info" %}
**文档信息**

* 最后更新：2024-08-29
* VergeOS 版本：4.12 及更高版本
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.verge.io/knowledge-base/zh/system-administration/setting-up-vergeos-as-identity-provider-oidc.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
