搜索

9.3. 在 Developer Hub 中配置 GitHub 应用程序

download PDF

要为 Developer Hub 添加 GitHub 身份验证,您必须在 app-config.yaml 文件中配置 GitHub App。

GitHub 身份验证供应商使用以下配置密钥:

  • clientId :您在 GitHub 上生成的客户端 ID。例如: b59241722e3c3b4816e2
  • clientSecret :与生成的客户端 ID 关联的客户端 secret。
  • enterpriseInstanceUrl (可选):GitHub Enterprise 实例的基本 URL。例如: https://ghe.<company>.com。只有 GitHub Enterprise 需要 enterpriseInstanceUrl
  • callbackUrl (可选):GitHub 在启动 OAuth 流时使用的回调 URL。例如: https://your-intermediate-service.com/handler。只有在 Developer Hub 不是直接接收器时,才需要 callbackUrl,例如当您将一个 OAuth 应用程序用于多个 Developer Hub 实例时。

要配置 GitHub App,请将供应商配置添加到 root auth 配置下的 app-config.yaml 文件中。例如:

auth:
 environment: production
 providers:
   github:
     production:
       clientId: ${GITHUB_APP_CLIENT_ID}
       clientSecret: ${GITHUB_APP_CLIENT_SECRET}
       ## uncomment if using GitHub Enterprise
       # enterpriseInstanceUrl: ${GITHUB_URL}
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.