# Налаштування SAML для GitLab (on premises)

### Налаштування GitLab

Відредагуйте файл “/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'] }
             }
    }
  ]
```

Після редагування виконайте команду `sudo gitlab-ctl reconfigure`.

### Налаштування HES

* Перейдіть до **Налаштування -> Параметри ->** розділ **SAML**
* Натисніть кнопку **Додати постачальника послуг:**
  * **Емітент** - **Entity ID з** GitLab
  * **Ствердження споживчої служби** - **ACS URL з** GitLab
  * **NameID формат** - Email
  * **NameID значення -** Електронна пошта


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enterprise-ua.hideez.com/integraciyi-servera-hideez/saml-integraciyi/nalashtuvannya-saml-dlya-gitlab-on-premises.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
