Setting up SAML for GitLab on premises

Configuring GitLab

Edit “/etc/gitlab/gitlab.rb”:

### OmniAuth Settings
###! Docs: https://docs.gitlab.com/ee/integration/omniauth.html
gitlab_rails['omniauth_enabled'] = true
gitlab_rails['omniauth_allow_single_sign_on'] = ['saml']
gitlab_rails['omniauth_block_auto_created_users'] = false
gitlab_rails['omniauth_auto_link_saml_user'] = true

gitlab_rails['omniauth_providers'] = [
    {
      name: 'saml',
      args: {
               assertion_consumer_service_url: 'https://gitlab.hideez.com/users/auth/saml/callback',
               idp_cert: 'MIIDHjCCAgagAwIBAg........',
               idp_sso_target_url: 'https://publicdemo.hideez.com/saml/login',
               issuer: 'https://gitlab.hideez.com',
               name_identifier_format: 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent',
               attribute_statements: { email: ['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress'] }
             }
    }
  ]

After editing use command sudo gitlab-ctl reconfigure.

Configuring HES

  • Go to Settings -> Parameters -> SAML section

  • Click Add Service Provider button:

    • Issuer - Entity ID from GitLab

    • Assertion Consumer Service - ACS URL from GitLab

    • NameID Format - Email

    • NameID Value - Email