GitLab 凭据(GitLab credentials)#
你可以使用以下凭据验证以下节点:
🌐 You can use these credentials to authenticate the following nodes:
支持的身份验证方法(Supported authentication methods)#
- API 访问令牌
- OAuth2(推荐)
相关资源(Related resources)#
有关该服务的更多信息,请参阅GitLab 的 API 文档。
🌐 Refer to GitLab's API documentation for more information about the service.
使用 API 访问令牌(Using API access token)#
要配置此凭据,你需要一个 GitLab 账户以及:
🌐 To configure this credential, you'll need a GitLab account and:
- 你的 GitLab 服务器 的 URL
- 一个 访问令牌
要设置凭据:
🌐 To set up the credential:
- 在 GitLab 中,选择你的头像,然后选择 编辑个人资料。
- 在左侧边栏中,选择 访问令牌。
- 选择 添加新令牌。
- 输入令牌的名称,例如
n8n integration。 - 输入令牌的到期日期。如果不输入到期日期,GitLab 会自动将其设置为比当前日期晚 365 天。
- 令牌将于指定到期日的 UTC 时间午夜过期。
- 选择所需的范围。对于 GitLab 节点,使用
api范围可以轻松授予该节点所有功能的访问权限。或参考 个人访问令牌范围 来选择你想使用的功能的范围。 - 选择 创建个人访问令牌。
- 复制此创建的访问令牌,并将其作为 访问令牌 输入到你的 n8n 凭证中。
- 在你的 n8n 凭证中输入你的 GitLab 服务器 的 URL。
有关更多信息,请参阅 GitLab 的 创建个人访问令牌文档。
🌐 Refer to GitLab's Create a personal access token documentation for more information.
使用 OAuth2(Using OAuth2)#
Note for n8n Cloud users
Cloud users don't need to provide connection details. Select Connect my account to connect through your browser.
如果你正在自托管 n8n,你将需要一个GitLab账户。然后创建一个新的 GitLab 应用:
🌐 If you're self-hosting n8n, you'll need a GitLab account. Then create a new GitLab application:
- 在 GitLab 中,选择你的头像,然后选择 编辑个人资料。
- 在左侧边栏中,选择 应用。
- 选择 添加新应用。
- 为你的应用输入一个名称,例如
n8n integration。 - 在 n8n 中,复制 OAuth 重定向 URL。将其作为 GitLab 的 重定向 URI 输入。
- 选择所需的范围。对于 GitLab 节点,使用
api范围可以轻松授予该节点所有功能的访问权限。或参考 个人访问令牌范围 来选择你想使用的功能的范围。 - 选择 保存应用。
- 复制 应用 ID 并将其作为 客户端 ID 输入到你的 n8n 凭证中。
- 复制 Secret 并将其作为 Client Secret 输入到你的 n8n 凭证中。
有关更多信息,请参阅 GitLab 的 将 GitLab 配置为 OAuth 2.0 身份验证身份提供者 文档。有关 OAuth2 和 GitLab 的更多信息,请参阅 GitLab OAuth 2.0 身份提供者 API 文档。
🌐 Refer to GitLab's Configure GitLab as an OAuth 2.0 authentication identity provider documentation for more information. Refer to the GitLab OAuth 2.0 identity provider API documentation for more information on OAuth2 and GitLab.