You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
qBittorrent: connect with the Web API key (qBittorrent 5.2+) instead of username and password
#1435
qBittorrent 5.2.0 added API-key authentication to its Web API (release-5.2.0: "WEBAPI: Add support for authenticating via API key"). A client sends Authorization: Bearer <key> with each request, without auth/login or a session cookie (webapplication.cpp#L689-L719 @release-5.3.0, #L818-L841).
Idea: an optional API key in the qBittorrent connection settings (a field in the connection form, and --qbapikey / FLOOD_OPTION_QBAPIKEY next to --qbuser/--qbpass in config.ts#L91-L102). When it is set, getRequestHeaders() sends Authorization: Bearer <key> and auth/login is skipped.
Why:
Flood no longer needs the WebUI password; the key can be rotated in qBittorrent without changing the password.
qBittorrent never bans an address for key requests (by default it bans after 5 failed logins), and a key keeps working after a qBittorrent restart, when cookie sessions are lost.
Notes from testing qBittorrent 5.3.0: a valid key is qbt_ + 28 characters (qBittorrent ignores any other value); key requests skip the CSRF check but not Host header validation.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
qBittorrent 5.2.0 added API-key authentication to its Web API (release-5.2.0: "WEBAPI: Add support for authenticating via API key"). A client sends
Authorization: Bearer <key>with each request, withoutauth/loginor a session cookie (webapplication.cpp#L689-L719 @release-5.3.0, #L818-L841).Flood 4.16.4 connects to qBittorrent with
url,usernameandpasswordonly (ClientConnectionSettings.ts#L16-L23): it logs in throughauth/loginand sends the session cookie (clientRequestManager.ts#L61-L81, #L108-L113).Idea: an optional API key in the qBittorrent connection settings (a field in the connection form, and
--qbapikey/FLOOD_OPTION_QBAPIKEYnext to--qbuser/--qbpassin config.ts#L91-L102). When it is set,getRequestHeaders()sendsAuthorization: Bearer <key>andauth/loginis skipped.Why:
Notes from testing qBittorrent 5.3.0: a valid key is
qbt_+ 28 characters (qBittorrent ignores any other value); key requests skip the CSRF check but not Host header validation.All reactions