VMware/GITLAB

From DER's LLC
Revision as of 19:09, 2 June 2023 by Admin (talk | contribs) (Created page with "= Setting up GITLAB with SSO = 1. vi /etc/gitlab/gitlab.rb gitlab_rails['omniauth_enabled'] = true gitlab_rails['omniauth_allow_single_sign_on'] = ['saml'] gitlab_rails['omniauth_sync_email_from_provider'] = 'saml' gitlab_rails['omniauth_sync_profile_from_provider'] = ['saml'] gitlab_rails['omniauth_sync_profile_attributes'] = ['email'] gitlab_rails['omniauth_auto_sign_in_with_provider'] = 'saml' gitlab_rails['omniauth_block_auto_created_users'] = false #gitlab_r...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Setting up GITLAB with SSO

1. vi /etc/gitlab/gitlab.rb

gitlab_rails['omniauth_enabled'] = true
gitlab_rails['omniauth_allow_single_sign_on'] = ['saml']
gitlab_rails['omniauth_sync_email_from_provider'] = 'saml'
gitlab_rails['omniauth_sync_profile_from_provider'] = ['saml']
gitlab_rails['omniauth_sync_profile_attributes'] = ['email']
gitlab_rails['omniauth_auto_sign_in_with_provider'] = 'saml'
gitlab_rails['omniauth_block_auto_created_users'] = false
#gitlab_rails['omniauth_auto_link_ldap_user'] = true 
gitlab_rails['omniauth_auto_link_saml_user'] = true
#gitlab_rails['omniauth_external_providers'] = ['twitter', 'google_oauth2']
#gitlab_rails['omniauth_allow_bypass_two_factor'] = ['google_oauth2']
gitlab_rails['omniauth_providers'] = [
  {
    "name" => "saml",
    "args" => {
        assertion_consumer_service_url: 'https://gitlab.dersllc.com/users/auth/saml/callback',
        idp_cert: '-----BEGIN CERTIFICATE-----
MIIEDTCCAnWgAwIBAgIFX8pgs88wDQYJKoZIhvcNAQELBQAwPzEgMB4GA1UEAwwX
Vk13YXJlIElkZW50aXR5IE1hbmFnZXIxDjAMBgNVBAoMBUxPR0lOMQswCQYDVQQG
EwJVUzAeFw0yMDA3MDgwMDMzMDBaFw0zMDA3MDYwMDMzMDBaMD8xIDAeBgNVBAMM
F1ZNd2Fy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YrGS/+1tjson1GFpzDGe
dBVmEA4UiiOObeKUywIWitaNazwpvjhg+2QZX3lCW8cm0d2FN5QxVBFscc7wsbim
3x6WNVCqYPZgcWzo1WDw9uhNnI5nTXIgdSwo9PyGvAVC
-----END CERTIFICATE-----',
        idp_sso_target_url: 'https://login.dersllc.com/SAAS/auth/federation/sso',
        issuer: 'ders-gitlab',
        name_identifier_format: 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent'
        },
    label: 'DERs Login'
  }
]
  • Go to vIDM administrative Console
  • Go to Catalog Tab -> Web Apps
  • Click the Settings Button.
  • Go to the SAML Metadata Tab.
  • Copy the Signing Certificate and paste it in the idp_cert section of the gitlab.rb file.
  • Click the Identity Provider (IdP) metadata Link.
  • Find the following location in the metadata
<md:SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" 
Location="https://login.dersllc.com/SAAS/auth/federation/sso"/>
  • Copy the Location URL: https://login.dersllc.com/SAAS/auth/federation/sso and paste it in the idp_sso_target_url section of the gitlab.rb file.
  • Set the Issuer as a friendly name for your gitlab sevrer.
  • set the assertion_consumer_service_url to 'https://<gitlab_URL>/users/auth/saml/callback'
  • Set the label as a friendly name for the button on the sign-on page.
  • Save and Exit the gitlab.rb file.
  • Run the reconfigure command.
 gitlab-ctl reconfigure
  • After this is complete. Go back to the vIDM Administrative Console.
  • Go to Catalog Tab -> Web Apps
  • Click the New button.
  • Create a name for the App and click next.
  • make sure the Authentication Type is set to SAML 2.0
  • On the gitlab server run the following to get the metadata xml for the gitlab server.
 curl --insecure https://gitlab.dersllc.com/users/auth/saml/metadata
  • Copy the output and paste it into the URL/XML: section of the new app form.
  • Click Next and Save & Assign.
  • Assign users to the App and attempt to login!