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

# Autenticação

Esta funcionalidade foi desenvolvida por [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep). Existem 3 métodos de autenticação suportados. Após a configuração, você pode fazer login com as seguintes opções, como a imagem abaixo mostra.

<figure><img src="/files/476b08d3f369f43e059b0c2199432d96dc39836e" alt=""><figcaption></figcaption></figure>

Recomendamos fortemente que você use OIDC, pois este é o método mais geral.

{% columns %}
{% column width="50%" %}
{% content-ref url="/spaces/h63iEBUnI5B0aXydAdRB/pages/0aac0288289c9802e6f6d85c860d39d874f96145" %}
[Autenticação OIDC](/on-premises/pt/configuracao/overleaf-toolkit/authentication/oidc-authentication.md)
{% endcontent-ref %}

{% content-ref url="/spaces/h63iEBUnI5B0aXydAdRB/pages/f1b7b7fa22298aefd67a71a280483867f7f8eb8e" %}
[Autenticação LDAP](/on-premises/pt/configuracao/overleaf-toolkit/authentication/ldap-authentication.md)
{% endcontent-ref %}
{% endcolumn %}

{% column width="50%" %}
{% content-ref url="/spaces/h63iEBUnI5B0aXydAdRB/pages/14aac592bafdb16263db986af48366a78a0653d2" %}
[Autenticação SAML](/on-premises/pt/configuracao/overleaf-toolkit/authentication/saml-authentication.md)
{% endcontent-ref %}

{% endcolumn %}
{% endcolumns %}

### Configuração Global

A variável de ambiente `EXTERNAL_AUTH` é necessário para ativar o módulo de autenticação específico. Esta variável de ambiente especifica quais métodos de autenticação externos estão ativados. As opções disponíveis são (em minúsculas):

* saml
* ldap
* oidc

### Sugestões para SSO

Testei saml, ldap, oauth para o Overleaf. Tanto saml quanto oauth funcionam bem no Overleaf, mas ldap depende. Não consegue funcionar bem para <https://docs.goauthentik.io/>, mas funciona bem no OpenLDAP (<https://github.com/rroemhild/docker-test-openldap>).

{% hint style="info" %}
Precisamos atualizar o passport-ldapauth; recentemente estou tentando testar o LDAP do Overleaf com <https://goauthentik.io/> , falhou. Depois de atualizar "passport-ldapauth" para 3.0.0, tudo funciona bem.

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

A versão original é 2.x.x, que é de 6 anos atrás.
{% endhint %}

Não tenho certeza de qual é o motivo, porque todos dependemos de um pacote externo para fazer autenticação LDAP (e também saml, oauth). Se não funcionar, a situação pode ser a mesma para o Overleaf Server Pro, porque apenas passamos todas as variáveis de ambiente para o pacote interno; se houver alguns bugs, atualmente não temos ideia.

**Então recomendo fortemente que nossos usuários configurem um ambiente de desenvolvimento para testar o SSO com todo o código-fonte**, que está disponível em [Setup Develop Environment (Local)](/dev/environment/setup-develop-environment-local.md). No ambiente de desenvolvimento, você pode ver todos os logs no terminal, o que torna conveniente para depuração.

\ <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/pt/configuracao/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.
