synapse-admin/docs/cors-credentials.md
Aine 218f0ba03c
Configurable CORS credentials (#456)
* Configurable CORS credentials

* update readme
2025-04-05 21:08:29 +03:00

36 lines
954 B
Markdown

# CORS Credentials
If you'd like to use cookie-based authentication
(for example, [ForwardAuth with Authelia](https://github.com/Awesome-Technologies/synapse-admin/issues/655)),
you can configure the `corsCredentials` option in the `config.json` file or in the `/.well-known/matrix/client` file.
## Configuration
> [Documentation on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#including_credentials)
The `corsCredentials` option accepts the following values:
* `same-origin` (default): Cookies will be sent only if the request is made from the same origin as the server.
* `include`: Cookies will be sent regardless of the origin of the request.
* `omit`: Cookies will not be sent with the request.
[Configuration options](config.md)
### config.json
```json
{
"corsCredentials": "include"
}
```
### `/.well-known/matrix/client`
```json
{
"cc.etke.synapse-admin": {
"corsCredentials": "include"
}
}
```