> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/on-premises/uk/konfiguraciya/overleaf-toolkit/authentication.md).

# Аутентифікація

Цю функцію розроблено [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep). Підтримуються 3 методи автентифікації. Після налаштування ви можете увійти, використовуючи такі варіанти, як показано на зображенні нижче.

<figure><img src="/files/122e230fcc3f6bbe7741c1e139614fa976bf4710" alt=""><figcaption></figcaption></figure>

Ми настійно рекомендуємо використовувати OIDC, оскільки це найзагальніший метод.

{% columns %}
{% column width="50%" %}
{% content-ref url="/spaces/MXvHSVNi78uafawQmqig/pages/91d8a19f0fccce4fbef77fa0b28c4b2a931695b5" %}
[Автентифікація OIDC](/on-premises/uk/konfiguraciya/overleaf-toolkit/authentication/oidc-authentication.md)
{% endcontent-ref %}

{% content-ref url="/spaces/MXvHSVNi78uafawQmqig/pages/6d9ec805eedded790f74561d2476917ad0a79a82" %}
[Автентифікація LDAP](/on-premises/uk/konfiguraciya/overleaf-toolkit/authentication/ldap-authentication.md)
{% endcontent-ref %}
{% endcolumn %}

{% column width="50%" %}
{% content-ref url="/spaces/MXvHSVNi78uafawQmqig/pages/70e1763924a6c1a2dbc9faab9ec95e52ff36c9b9" %}
[Автентифікація SAML](/on-premises/uk/konfiguraciya/overleaf-toolkit/authentication/saml-authentication.md)
{% endcontent-ref %}

{% endcolumn %}
{% endcolumns %}

### Глобальна конфігурація

Змінна середовища `EXTERNAL_AUTH` потрібна, щоб увімкнути конкретний модуль автентифікації. Ця змінна середовища визначає, які зовнішні методи автентифікації активовано. Доступні варіанти (малими літерами):

* saml
* ldap
* oidc

### Поради щодо SSO

Я тестував saml, ldap, oauth для Overleaf. І saml, і oauth добре працюють в Overleaf, але з ldap все залежить. Це не може добре працювати для <https://docs.goauthentik.io/>, але це добре працює в openLDAP (<https://github.com/rroemhild/docker-test-openldap>).

{% hint style="info" %}
Нам потрібно оновити passport-ldapauth, нещодавно я намагався протестувати LDAP Overleaf з <https://goauthentik.io/> , це не спрацювало. Після того як я оновив "passport-ldapauth" до 3.0.0, усе працює добре.

```
"passport-ldapauth": "^3.0.0",
```

Початкова версія була 2.x.x, і це було 6 років тому.
{% endhint %}

Я не впевнений, у чому причина, тому що ми всі залежимо від зовнішнього пакета для LDAP-автентифікації (а також saml, oauth). Якщо це не працює, ситуація може бути такою самою і для Overleaf Server Pro, бо ми просто передаємо всі змінні середовища до внутрішнього пакета; якщо там є якісь помилки, наразі ми не маємо жодного уявлення.

**Тому я настійно рекомендую нашим користувачам налаштувати середовище розробки, щоб тестувати SSO з усім вихідним кодом**, який доступний за адресою [Setup Develop Environment (Local)](/dev/environment/setup-develop-environment-local.md). У середовищі розробки ви можете бачити всі журнали в терміналі, що робить його зручним для налагодження.

\ <br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/on-premises/uk/konfiguraciya/overleaf-toolkit/authentication.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
