qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
28.21k stars 3.97k forks source link

Support basic auth #15007

Open yegle opened 3 years ago

yegle commented 3 years ago

Please provide the following information

qBittorrent version and Operating System

4.3.5 running in Docker

If on linux, libtorrent-rasterbar and Qt version

NA (it's a feature request)

What is the problem

The current web UI does not support basic auth.

What is the expected behavior

The web UI supports basic auth.

Steps to reproduce

(type here)

Extra info(if any)

I use a identity aware proxy (https://pomerium.io, but there are many other IAP out there). The basic idea of IAP is that you need to complete an OAuth login before you can be proxied to the backend. See also the relevant doc in Grafana: https://grafana.com/docs/grafana/latest/auth/auth-proxy/

Transmission is a BitTorrent client whose webUI used basic auth. My current setup with Transmission is:

  1. For PRC http endpoints, Pomerium act as a normal HTTP proxy thus requires basic auth.
  2. For other endpoints, Pomerium act as an auth proxy, but add a Authentication: header when sending request to the backend.

The end result is: I can access the web UI directly using my Google account login, while other clients (e.g. transmission-cli) still requires full username/password to access the server.

I wish this feature can be implemented in qBittorrent as well.

userdocs commented 3 years ago

This is what i do to disable auth and use authelia.

image

I'd guess it would work for you.

yegle commented 3 years ago

Disabling auth and solely rely on identity aware proxy is fine if you only interact with qBittorrent using the web UI.

In my case I also want to use an Android client (qBittorrent Remote Controller FWIW) which won't work with an IAP.

userdocs commented 3 years ago

All these apps use the WebUI which use the API. So what you are really asking for is an alternate method to auth to the api. Personally i'd much rather see auth tokens for this but now it's starting to get weird because you can simply disable auth as i said and create your own basic auth using nginx/apache.

https://play.google.com/store/apps/details?id=com.lgallardo.qbittorrentclient&hl=en_GB&gl=US

In order to make it work you must have already configured your qBittorrent Web UI. Please check your server configurations with your browser before using this app.

Or use a better app https://play.google.com/store/apps/details?id=com.kevinforeman.nzb360&hl=en_GB&gl=US

rumplin commented 3 years ago

If you use VPN to connect to your network, you could set up IP ranges, like that: image

It's working for me on all my devices, once I am in the VPN network or locally in the network.

yegle commented 3 years ago

OK I realized to support basic auth would be an overhaul of the authentication system and implement something like Transmission's X-Transmission-Session-Id to avoid CSRF.

Even with that done I would need to patiently wait for the client I'm using to switch to the new auth system.

I guess this is too far reach?

Re VPN: I don't like using VPN as it's stateful and require a couple seconds delay to establish the connection.

The only alternative that I can think of is to do mTLS and install the client TLS certificate on the device I own.

geeklihui commented 2 years ago

This is what i do to disable auth and use authelia.

image

I'd guess it would work for you.

Hi I‘m using traefik + authelia, and set "Bypass authentication for clients on localhost" as your picture. But I still see login page after I login to authelia whether I'm in localhost network or not. Could you please give some advice? Thanks a lot.