> For the complete documentation index, see [llms.txt](https://docs.madrix.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.madrix.dev/br/solucao-de-problemas/sso-e-login.md).

# SSO e login

### Quando usar

* Login em loop.
* SSO retorna erro após autenticar no IdP.
* Usuário autentica, mas não tem acesso ao projeto.

### Checklist rápido (2 min)

1. Teste em aba anônima.
2. Limpe cookies do domínio.
3. Confirme que o usuário está no tenant/organização correta.

### Diagnóstico

#### 1) Permissões vs autenticação

* **Autenticou** mas não vê recursos: costuma ser permissão/grupo.
* **Não autenticou**: costuma ser configuração SSO/callback.

#### 2) Callback e redirect URI

* Confirme se o `redirect/callback URL` do IdP bate exatamente com o configurado.
* Cheque se há diferença de http/https ou domínio.

#### 3) Clock skew e expiração

* Tokens expiram rápido?
* Erros variam por usuário/máquina?

### Como resolver (padrões)

* **Loop**: limpar cookies e revisar domínio/callback.
* **403 após login**: ajustar grupos/roles e mapeamento de claims.
* **Erro só em um navegador**: extensão bloqueando cookies/3rd-party.

### Quando escalar

* Todos os usuários de uma org falham.
* Erro de callback repetível.
* Mudança recente em IdP (certificado/metadata) e quebra geral.

Antes de escalar, junte estas evidências. Isso reduz muito o ping-pong.

* Projeto e ambiente (Dev/Staging/Prod).
* Horário do erro (com timezone).
* Passos para reproduzir (curto e determinístico).
* Mensagem de erro completa (sem prints cortados).
* Screenshot da tela (se aplicável).
* Console do browser (erros e warnings relevantes).
* Aba **Network** (request que falhou + status + payload, se não houver dados sensíveis).

{% hint style="info" %}
Se existir um `requestId`, `traceId` ou link de execução, inclua também.
{% endhint %}


---

# 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://docs.madrix.dev/br/solucao-de-problemas/sso-e-login.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.
