> 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/configuration/overleaf-toolkit/authentication.md).

# Authentication

This feature is developed by [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep). There are 3 authentication methods supported. After configuration, you can login with the following options, as image below shows.

<figure><img src="/files/HwNKx1bW8guUo4lsPUM1" alt=""><figcaption></figcaption></figure>

We highly recommend you use OIDC, since this is the most general method.

{% columns %}
{% column width="50%" %}
{% content-ref url="/spaces/yLFrF2L1FakWXkhqpOnS/pages/MNxtqAesrEmBsuaCyyZJ" %}
[OIDC Authentication](/on-premises/configuration/overleaf-toolkit/authentication/oidc-authentication.md)
{% endcontent-ref %}

{% content-ref url="/spaces/yLFrF2L1FakWXkhqpOnS/pages/dWyWgbLr6fbVRRm6D2nI" %}
[LDAP Authentication](/on-premises/configuration/overleaf-toolkit/authentication/ldap-authentication.md)
{% endcontent-ref %}
{% endcolumn %}

{% column width="50%" %}
{% content-ref url="/spaces/yLFrF2L1FakWXkhqpOnS/pages/wn4a2vzx67rph5o0XxeZ" %}
[SAML Authentication](/on-premises/configuration/overleaf-toolkit/authentication/saml-authentication.md)
{% endcontent-ref %}

{% endcolumn %}
{% endcolumns %}

### Global Configuration

The environment variable `EXTERNAL_AUTH` is required to enable the specific authentication module. This environment variable specifies which external authentication methods are activated. Available options are (in lower case):

* saml
* ldap
* oidc

### Suggestions for SSO

I tested saml, ldap, oauth for overleaf. Both saml, oauth works well in overleaf, but ldap, it depends. It can't works well for <https://docs.goauthentik.io/>, but it works well in openLDAP (<https://github.com/rroemhild/docker-test-openldap>).

{% hint style="info" %}
We need to update passport-ldapauth, recently I am trying to test overleaf ldap with <https://goauthentik.io/> , it failed. After I update "passport-ldapauth" to 3.0.0, everything works well.

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

The origianlly one is 2.x.x, which is 6 years ago.
{% endhint %}

I am not sure what's the reason, because we all depends on an external package to do LDAP (also saml, oauth) auth. If not worked, the situtation can be the same for overleaf server pro, becase we just passed all environment var to internal package, if there are some bugs, we have no idea currently.

**So I highly recommend our user to setup development enviornment to test SSO with all source code**, which is available at [Setup Develop Environment (Local)](/dev/environment/setup-develop-environment-local.md). In development environment, you can see all logs in terminal, which makes it convenient for debug usage.

\ <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/configuration/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.
