使用 SAML 连接 GitLab 帐户

use*_*140 3 ruby git saml gitlab

我正在尝试将 SAML 身份验证与 GitLab 结合使用。在 gitlab.rb 中我指定

gitlab_rails['omniauth_enabled'] = true
gitlab_rails['omniauth_allow_single_sign_on'] = false
gitlab_rails['omniauth_block_auto_created_users'] = false
gitlab_rails['omniauth_providers'] = [
    {
      "name" => "saml",
       args: {
assertion_consumer_service_url: 'https://git.mycompany.com/users/auth/saml/callback',
               idp_cert_fingerprint: 'XX:YY:ZZ',
               idp_sso_target_url: 'https://myidentity.com/SAAS/auth/federation/sso',
               issuer: 'https://git.mycompany.com',
               name_identifier_format: 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress'
             }
    }
  ]
Run Code Online (Sandbox Code Playgroud)

现在,当我尝试使用 SAML 登录时,出现错误

不允许在没有预先存在的 GitLab 帐户的情况下使用您的 Saml 帐户登录。首先创建一个 GitLab 帐户,然后将其连接到您的 Saml 帐户。

我已经创建了一个名为 user1@mycompany.com 的 Git 用户

我该如何修复这个错误?

use*_*140 5

更改这些参数就可以解决问题。

gitlab_rails['omniauth_allow_single_sign_on'] = true
gitlab_rails['omniauth_block_auto_created_users'] = false
Run Code Online (Sandbox Code Playgroud)

  • 格式可以具体: gitlab_rails['omniauth_allow_single_sign_on'] = ['saml','google','bitbucket','gitlab','etc'] (2认同)