Updated Authentication methods (markdown)

Marco Piovanello
2025-01-13 13:07:01 +01:00
parent b246d6464f
commit 28ceb56a51

@@ -53,4 +53,34 @@ Provide your `config.yml` to yt-dlp-webui:
# or with docker # or with docker
docker exec --rm -d -p 3033:3033 -v <your_config_directory>:/conf ghcr.io/marcopeocchi/yt-dlp-web-ui:latest docker exec --rm -d -p 3033:3033 -v <your_config_directory>:/conf ghcr.io/marcopeocchi/yt-dlp-web-ui:latest
```
## API Authentication
About the API authentication: there's three methods to provide the token:
- cookies: cookie named `jwt-yt-dlp-webui`
- query params: `?token=yourjwttoken`
- headers: `X-Authentication` header
### How to obtain the token
```
curl -H "Content-Type: application/json" \
-X POST \
-d '{"username":"ciao","password":"ciaociao"}' \
http://localhost:3033/auth/login
```
where `http://localhost:3033` will be replaced with your ip/hostname.
The JWT token will be returned in the response.
### Execute requests with token
As described before, with token or query params.
Here's an example using query params:
```
curl -H "Content-Type: application/json" \
-X POST \
-d '{"url": "http://some.video/1"}' \
http://localhost:3033/api/v1/exec?token=eyJhbGciOiJIUzI1NiIsInR5cC...
``` ```