> For the complete documentation index, see [llms.txt](https://ayakaleaf-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://ayakaleaf-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="/pages/91d8a19f0fccce4fbef77fa0b28c4b2a931695b5" %}
[Автентифікація OIDC](/on-premises/uk/konfiguraciya/overleaf-toolkit/authentication/oidc-authentication.md)
{% endcontent-ref %}

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

{% column width="50%" %}
{% content-ref url="/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://ayakaleaf-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.
