使用SAML连接GitLab帐户

时间:2015-10-08 19:21:59

标签: ruby git gitlab saml

我正在尝试使用GitLab进行SAML身份验证。在我指定的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'
             }
    }
  ]

现在,当我尝试使用SAML登录时,我收到了错误

  

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

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

如何解决此错误?

2 个答案:

答案 0 :(得分:2)

更改这些参数使其得以修复。

gitlab_rails['omniauth_allow_single_sign_on'] = true
gitlab_rails['omniauth_block_auto_created_users'] = false

答案 1 :(得分:0)

仅参数true中的gitlab_rails['omniauth_allow_single_sign_on']有帮助。 指定的提供商列表对我不起作用。 尝试设置true,而不是['saml','google','bitbucket','gitlab','etc']

在GitLab 12.3上测试