Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect a GitLab account with SAML

I am trying to use SAML authentication with GitLab. In the gitlab.rb I specified

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'
             }
    }
  ]

Now when I try to login using SAML I get the error

Signing in using your Saml account without a pre-existing GitLab account is not allowed. Create a GitLab account first, and then connect it to your Saml account.

I have already created a Git User named [email protected]

How do I fix this error ?

like image 924
user1191140 Avatar asked Dec 07 '25 02:12

user1191140


1 Answers

Changing these parameters got it fixed.

gitlab_rails['omniauth_allow_single_sign_on'] = true
gitlab_rails['omniauth_block_auto_created_users'] = false
like image 126
user1191140 Avatar answered Dec 08 '25 14:12

user1191140



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!