> 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/vi/cau-hinh/overleaf-toolkit/authentication.md).

# Xác thực

Tính năng này được phát triển bởi [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep). Có 3 phương thức xác thực được hỗ trợ. Sau khi cấu hình, bạn có thể đăng nhập với các tùy chọn sau, như hình dưới đây cho thấy.

<figure><img src="/files/6863bb858ae616aa72b28d6cdaf9903c95c40486" alt=""><figcaption></figcaption></figure>

Chúng tôi đặc biệt khuyên bạn sử dụng OIDC, vì đây là phương pháp tổng quát nhất.

{% columns %}
{% column width="50%" %}
{% content-ref url="/spaces/zw4u2hatU7Prp9lJMJKj/pages/714d1e6d0315d012cddfb48c7f63cf49972e4cd7" %}
[Xác thực OIDC](/on-premises/vi/cau-hinh/overleaf-toolkit/authentication/oidc-authentication.md)
{% endcontent-ref %}

{% content-ref url="/spaces/zw4u2hatU7Prp9lJMJKj/pages/a25d1226b43d083434dc51d95c6e7d6e4f19de77" %}
[Xác thực LDAP](/on-premises/vi/cau-hinh/overleaf-toolkit/authentication/ldap-authentication.md)
{% endcontent-ref %}
{% endcolumn %}

{% column width="50%" %}
{% content-ref url="/spaces/zw4u2hatU7Prp9lJMJKj/pages/0aefe53ed2dfe6e7d0d2d6033e186d6cfe55db36" %}
[Xác thực SAML](/on-premises/vi/cau-hinh/overleaf-toolkit/authentication/saml-authentication.md)
{% endcontent-ref %}

{% endcolumn %}
{% endcolumns %}

### Cấu hình toàn cục

Biến môi trường `EXTERNAL_AUTH` là bắt buộc để bật mô-đun xác thực cụ thể. Biến môi trường này chỉ định những phương thức xác thực bên ngoài nào được kích hoạt. Các tùy chọn có sẵn là (viết thường):

* saml
* ldap
* oidc

### Gợi ý cho SSO

Tôi đã thử saml, ldap, oauth cho Overleaf. Cả saml và oauth đều hoạt động tốt trong Overleaf, nhưng với ldap thì còn tùy. Nó không thể hoạt động tốt cho <https://docs.goauthentik.io/>, nhưng nó hoạt động tốt trong openLDAP (<https://github.com/rroemhild/docker-test-openldap>).

{% hint style="info" %}
Chúng ta cần cập nhật passport-ldapauth, gần đây tôi đang cố gắng kiểm tra Overleaf LDAP với <https://goauthentik.io/> , nó đã thất bại. Sau khi tôi cập nhật "passport-ldapauth" lên 3.0.0, mọi thứ hoạt động tốt.

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

Bản gốc là 2.x.x, tức là từ 6 năm trước.
{% endhint %}

Tôi không chắc lý do là gì, vì tất cả chúng ta đều phụ thuộc vào một gói bên ngoài để thực hiện xác thực LDAP (cũng như saml, oauth). Nếu không hoạt động, tình huống có thể giống với Overleaf Server Pro, bởi vì chúng tôi chỉ truyền toàn bộ biến môi trường cho gói nội bộ; nếu có lỗi nào đó, hiện tại chúng tôi cũng không biết.

**Vì vậy, tôi đặc biệt khuyên người dùng của chúng tôi thiết lập môi trường phát triển để kiểm tra SSO với toàn bộ mã nguồn**, được cung cấp tại [Setup Develop Environment (Local)](/dev/environment/setup-develop-environment-local.md). Trong môi trường phát triển, bạn có thể thấy tất cả nhật ký trong terminal, điều này rất tiện cho việc gỡ lỗi.

\ <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/vi/cau-hinh/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.
