Authentication methods
Built-in Authentication
The built-in authentication is enabled by default and uses a username/password combination. When you first access autobrr, you'll be prompted to create an account.
autobrr supports a single user account. If you need more identities, use an OIDC provider without restricting the allowed user; all logins share the same autobrr instance and data.
Failed login limit
Failed logins are rate limited per client. After 5 failed attempts, a client gets one more attempt every 20 seconds, and further attempts get 429 Too Many Requests with a Retry-After header. A successful login resets the counter, so you are never locked out by your own logins.
Behind a reverse proxy, the limit applies per client address only when autobrr knows which peers are proxies. Set trustedProxies so the limit cannot be dodged with a spoofed X-Forwarded-For header, or used to lock out other users behind the same proxy.
Failed login limit
Failed logins are rate limited per client. After 5 failed attempts, a client gets one more attempt every 20 seconds, and further attempts get 429 Too Many Requests with a Retry-After header. A successful login resets the counter, so you are never locked out by your own logins.
Behind a reverse proxy, the limit applies per client address only when autobrr knows which peers are proxies. Set trustedProxies so the limit cannot be dodged with a spoofed X-Forwarded-For header, or used to lock out other users behind the same proxy.
Sessions
Sessions last 30 days and are automatically extended while in use (renewal happens when a session is within 7 days of expiring). The Remember me checkbox on the login page, checked by default, controls whether the session cookie persists across browser restarts.
Sessions are stored in the database, so they survive autobrr restarts. Logging out destroys the session server-side.
Changing your password signs out every other session. The session you changed it from stays logged in.
Trusted proxies
autobrr reads the client IP from X-Forwarded-For, X-Real-IP and True-Client-IP for logs and for the failed login limit. By default those headers are believed from any peer. List the address of your reverse proxy in trustedProxies to only believe X-Forwarded-For from it:
trustedProxies = ["127.0.0.1", "::1"]
AUTOBRR__TRUSTED_PROXIES=127.0.0.1,::1
Entries are IP addresses or CIDRs. With trustedProxies set, X-Forwarded-For is read right to left, skipping trusted proxies, and the first untrusted address is used as the client IP. Requests from any other peer use the TCP peer address. trustedProxies has no effect while authentication is disabled.
OpenID Connect (OIDC)
autobrr supports OIDC authentication for integration with external identity providers like Authentik, Authelia, Pocket-ID, and more.
Configuration
1. Configure your identity provider
- Set up a new application/client in your identity provider
- Set the redirect URI to:
https://your-autobrr-instance/api/auth/oidc/callback - Note down the client ID and client secret
When using Authentik, configure the following:
- Use RS256 signing algorithm
- Under Protocol Settings, select an RSA "Signing Key" (e.g., the Authentik self-signed certificate)
For more details on Authentik setup, see:
2. Enable OIDC in autobrr
Choose one of these configuration methods:
oidcEnabled = true
oidcIssuer = "https://your-identity-provider"
oidcClientId = "your-client-id"
oidcClientSecret = "your-client-secret"
oidcRedirectUrl = "https://your-autobrr-instance/api/auth/oidc/callback"
oidcDisableBuiltInLogin = false
Or using environment variables:
AUTOBRR__OIDC_ENABLED=true
AUTOBRR__OIDC_ISSUER=https://your-identity-provider
AUTOBRR__OIDC_CLIENT_ID=your-client-id
AUTOBRR__OIDC_CLIENT_SECRET=your-client-secret
AUTOBRR__OIDC_REDIRECT_URL=https://your-autobrr-instance/api/auth/oidc/callback
AUTOBRR__OIDC_DISABLE_BUILT_IN_LOGIN=false
When OIDC is enabled:
- If you have an existing user in the database, both OIDC and built-in authentication will be available
- If no user exists in the database, only OIDC authentication will be available
3. Restrict login to one user
By default, any user your identity provider authenticates for the autobrr client can log in. To allow only one user, set either oidcAllowedSubject to that user's subject identifier (sub), or oidcAllowedEmail to their email address. Set one of the two, not both: autobrr refuses to start when both are set.
oidcAllowedSubject = "3f2c1a9e-5b7d-4e61-9a0c-2d8f6b4e1c37"
# or
oidcAllowedEmail = "you@example.com"
AUTOBRR__OIDC_ALLOWED_SUBJECT=3f2c1a9e-5b7d-4e61-9a0c-2d8f6b4e1c37
# or
AUTOBRR__OIDC_ALLOWED_EMAIL=you@example.com
oidcAllowedSubjectmust match the subject identifier exactly, including case. Your identity provider shows it on the user's profile, or you can find it in the autobrr log at debug level after an OIDC login. Prefer this setting: the subject never changes and the provider guarantees it is unique.oidcAllowedEmailmatches regardless of case, but only when the identity provider marks the email as verified (email_verified). If your provider does not send that claim, useoidcAllowedSubjectinstead. If your provider lets several accounts share the same email address, all of them can log in with this setting; useoidcAllowedSubjectto limit login to exactly one account.- Each setting is only compared against its own claim, so an account whose subject identifier happens to equal the allowed email address does not get in.
- Other users get a 403 error after signing in at the identity provider and are logged as
OIDC user is not allowed to log in. WithoidcAllowedEmail, a 502 error means autobrr could not reach the provider's userinfo endpoint to verify the email; the details are in the autobrr log. - autobrr checks every request against these settings, so setting or changing them logs out any existing OIDC session that no longer matches. Sessions created before autobrr supported these settings are logged out once one is set, and the user has to log in again.
When neither setting is set, autobrr logs a warning at startup. You can also restrict access in the identity provider itself, for example with application bindings in Authentik or access control policies in Authelia.
autobrr automatically uses the Authorization Code Flow with PKCE (S256) when your identity provider advertises support for it in its discovery document. Providers that require PKCE (like Pocket-ID) work out of the box with no extra configuration.
Automatic login
By default, the login page shows an OpenID Connect button. To skip the login page and send visitors straight to your identity provider, enable automatic login:
oidcAutoRedirect = true
AUTOBRR__OIDC_AUTO_REDIRECT=true
It requires oidcEnabled = true and takes effect after a restart. After you log in at the provider, autobrr opens the page you were trying to reach.
oidcDisableBuiltInLogin still controls whether the login page shows the username and password form. With automatic login on, autobrr only shows the login page in the cases below.
Open the login page
Open /login?autoRedirect=false to get the login page without being redirected, for example when your identity provider is down. Add your base URL in front if you set one, such as /autobrr/login?autoRedirect=false.
Logging out
Logging out of autobrr, or changing your password or username in Settings > Account, ends the autobrr session and opens that login page. Your identity provider session stays active, so clicking OpenID Connect may log you straight back in without asking for credentials. To sign out completely, also log out at your identity provider.
If you are sent back to the login page
If autobrr comes back from your identity provider without a session within 30 seconds of an automatic redirect, it stops redirecting and shows the login page with a warning that automatic sign-in did not complete. Otherwise the browser would bounce between autobrr and the provider.
This usually means the browser did not keep autobrr's session cookie. Check that:
- you open autobrr at the base URL configured in autobrr, since the session cookie only applies to that path
- your reverse proxy passes cookies through and forwards
X-Forwarded-Protocorrectly (see Security Best Practices) - the browser does not block cookies for your autobrr domain
Forward authentication
If a reverse proxy in front of autobrr authenticates every request (Authelia, Authentik, or any forward_auth/auth_request setup), autobrr can take the username from a header the proxy sets instead of using its own login. You sign in once, at the proxy. Compared to disabling authentication:
- every request must carry the header. A request without it gets
403 Forbidden, so a proxy that stops authenticating locks you out instead of letting everyone in - only one username is accepted,
authTrustedUser. autobrr has a single account, so other users your identity provider knows get403 Forbidden - the logs show which user made each request
- API keys and API key management keep working. A request with an API key is handled as that key, header or not
- the login page and the account page are skipped, and log out goes to your proxy's logout URL if you set one
- the same request checks as disabled mode apply: peer allowlist,
Hostallowlist, browser request checks, JSON writes and framing - it cannot be combined with
authDisabled,oidcEnabled,oidcDisableBuiltInLogin,oidcAutoRedirect,oidcAllowedSubjectoroidcAllowedEmail. The otheroidc*settings are ignored
autobrr trusts the header because only your proxy can reach it. If the proxy passes on a header the client sent, anyone can claim to be authTrustedUser. This matters most on paths your identity provider lets through without a login (an Authelia bypass rule for /api, for example): there the auth server returns no username, and the proxy must remove the client's header rather than forward it. The examples below do this. Check your proxy after setting it up.
Configuration
All of these are required:
# The header your proxy sets with the authenticated username.
# Authelia: Remote-User, Authentik: X-authentik-username.
authTrustedUserHeader = "Remote-User"
# The only user accepted, exactly as your proxy sends it, including case.
authTrustedUser = "ze0s"
# The TCP peer autobrr sees, i.e. your reverse proxy. Single addresses only.
authAllowedPeerCIDRs = ["127.0.0.1/32"]
# Every URL you open autobrr at, comma separated, scheme://host[:port], no wildcards.
corsAllowedOrigins = "https://autobrr.example.com"
Optional:
# Where log out goes, normally your proxy's logout URL. Unset hides log out.
authLogoutURL = "https://auth.example.com/logout"
# Same as in disabled mode.
authAllowedHosts = ["autobrr"]
authClientIPHeader = "X-Real-IP"
Or using environment variables:
AUTOBRR__AUTH_TRUSTED_USER_HEADER=Remote-User
AUTOBRR__AUTH_TRUSTED_USER=ze0s
AUTOBRR__AUTH_ALLOWED_PEER_CIDRS=127.0.0.1/32
AUTOBRR__CORS_ALLOWED_ORIGINS=https://autobrr.example.com
AUTOBRR__AUTH_LOGOUT_URL=https://auth.example.com/logout
If any required option is missing or invalid, autobrr refuses to start and logs which one. X-API-Token cannot be the user header, since autobrr reads API keys from it. Every authAllowedPeerCIDRs entry must be a single address (/32 or /128): any allowlisted peer can send the header itself, so a range would let every address in it log in.
Proxy examples
nginx with Authelia. /internal/authelia/authz is the location from Authelia's nginx guide. proxy_set_header replaces a Remote-User sent by the client, and leaves it out when $user is empty:
location / {
auth_request /internal/authelia/authz;
auth_request_set $user $upstream_http_remote_user;
proxy_set_header Remote-User $user;
proxy_pass http://127.0.0.1:7474;
}
Caddy with Authelia. copy_headers replaces a Remote-User sent by the client, and removes it when Authelia returns none:
autobrr.example.com {
forward_auth authelia:9091 {
uri /api/authz/forward-auth
copy_headers Remote-User
}
reverse_proxy localhost:7474
}
Traefik with Authentik. authResponseHeaders replaces an X-authentik-username sent by the client, and removes it when Authentik returns none:
http:
middlewares:
authentik:
forwardAuth:
address: http://authentik-server:9000/outpost.goauthentik.io/auth/traefik
authResponseHeaders:
- X-authentik-username
Use authResponseHeaders as above. authResponseHeadersRegex is matched case-sensitively against the header name as Traefik writes it (X-Authentik-Username), so a pattern like ^X-authentik- matches nothing and the header the client sent reaches autobrr unchanged.
Check your proxy
Send a request with a forged header to a path your identity provider does not protect, if you have one (for example an /api bypass rule). Use your own authTrustedUserHeader as the header and your own authTrustedUser as the value. A forged header with any other name proves nothing, because autobrr ignores it:
# Authelia (authTrustedUserHeader = "Remote-User")
curl -i -H 'Remote-User: ze0s' https://autobrr.example.com/api/auth/validate
# Authentik (authTrustedUserHeader = "X-authentik-username")
curl -i -H 'X-authentik-username: ze0s' https://autobrr.example.com/api/auth/validate
403 Forbidden: the proxy removed the header. This is what you want.- A redirect or
401from your identity provider: the path is protected, nothing to check there. 200 OKwith your username: the proxy passes on headers from the client. Fix the proxy before relying on forward authentication.
Things to watch out for
- Keep
host = "127.0.0.1"(or another private bind) so the autobrr port is only reachable through the proxy, as in disabled mode. authTrustedUsermust match what the proxy sends exactly, including case: identity providers can hold accounts that differ only by case, so autobrr does not treat them as the same user. Some providers send an email address or display name rather than the username. Rejected requests are logged with the username autobrr received.- If the UI shows the login page, the header is not reaching autobrr. The log has a
forward auth: rejected request without trusted user headerwarning for each such request. - Groups headers such as
Remote-Groupsare not read. The one accepted user has full access.
Disable authentication
Every request from an allowlisted network address gets full administrative access. Only use this when a reverse proxy in front of autobrr authenticates every route, and the autobrr port cannot be reached any other way.
If your reverse proxy already handles authentication, you can disable autobrr's own login so you don't have to sign in twice. If the proxy can pass the username on in a header (Authelia and Authentik both can), use forward authentication instead: it keeps a check on every request and keeps API keys working. With authentication disabled:
- autobrr skips the login page and opens straight to the dashboard
- the account page and the logout button are hidden
- API key management is unavailable. An unauthenticated caller could otherwise create a key that keeps working after you re-enable authentication. API keys you already have keep working once authentication is back on
- requests are accepted only from the network peers in
authAllowedPeerCIDRs, so scripts and integrations behind the same proxy do not need an API key - OIDC cannot be enabled at the same time
Configuration
All of these are required:
authDisabled = true
authDisabledAcknowledgement = "I_ACKNOWLEDGE_THIS_IS_A_BAD_IDEA"
# The TCP peer autobrr sees, i.e. your reverse proxy. NOT the end user's address.
authAllowedPeerCIDRs = ["127.0.0.1/32", "::1/128"]
# Every URL you open autobrr at, comma separated, scheme://host[:port], no wildcards.
corsAllowedOrigins = "https://autobrr.example.com"
Optional:
# Extra hostnames clients or your proxy use in the Host header.
authAllowedHosts = ["autobrr"]
# A header your proxy overwrites on every request with the end user's IP.
# Only used to log client IPs; leave unset to log the proxy address.
authClientIPHeader = "X-Real-IP"
Or using environment variables:
AUTOBRR__AUTH_DISABLED=true
AUTOBRR__AUTH_DISABLED_ACKNOWLEDGEMENT=I_ACKNOWLEDGE_THIS_IS_A_BAD_IDEA
AUTOBRR__AUTH_ALLOWED_PEER_CIDRS=127.0.0.1/32,::1/128
AUTOBRR__CORS_ALLOWED_ORIGINS=https://autobrr.example.com
AUTOBRR__AUTH_ALLOWED_HOSTS=autobrr
AUTOBRR__AUTH_CLIENT_IP_HEADER=X-Real-IP
If authDisabled is set without the exact acknowledgement value, authentication stays enabled and autobrr logs a warning. If the acknowledgement is correct but any other required option is missing or invalid, autobrr refuses to start.
Example with Caddy doing forward auth through Authelia for every route:
autobrr.example.com {
forward_auth authelia:9091 {
uri /api/authz/forward-auth
}
reverse_proxy localhost:7474
}
How requests are checked
- Peer allowlist.
authAllowedPeerCIDRsis matched against the address of the TCP connection, never againstX-Forwarded-Foror similar headers, so a client cannot spoof its way in. In Docker this is the proxy container's address on the shared network, not your browser's IP. The health check endpoints are also allowed from loopback so container health checks keep working. - Host header. Every request must use an allowed hostname in its
Hostheader, which blocks DNS rebinding. IP addresses,localhost, the machine hostname and the hosts incorsAllowedOriginsare always allowed. Add any other name toauthAllowedHosts, for exampleautobrrwhen nginx proxies tohttp://autobrr:7474withoutproxy_set_header Host $host;. Rejected requests are logged with the host they used. - Browser requests. API requests from a browser must come from an origin in
corsAllowedOrigins, or from the same origin autobrr is served at (for example the UI opened athttp://192.168.1.10:7474). Requests from other sites, including other subdomains of your domain, are rejected. This stops a malicious page you visit from driving autobrr through your browser. - JSON writes. API requests that send a body must use
Content-Type: application/json, otherwise they get415 Unsupported Media Type. - Framing. Only autobrr itself and the origins in
corsAllowedOriginsmay embed autobrr in a frame.
All other blocked requests get 403 Forbidden and a warning in the log saying which check failed.
Things to watch out for
- Keep
host = "127.0.0.1"(or another private bind) so the autobrr port is only reachable through the proxy. A0.0.0.0bind together with a broad allowlist gives admin access to everything in the range: Docker network gateways, Kubernetes node addresses and shared proxy or CDN ranges can all carry traffic from someone other than your proxy. - List the exact proxy address (
/32or/128), not its subnet. autobrr logs a warning at startup for every broader range. - If you never created a user, re-enabling authentication opens first-user onboarding to whoever reaches the login page first. Create the user right after re-enabling, or ahead of time with
autobrrctl create-user.
Re-enable authentication
Remove the authDisabled settings (or environment variables), restart autobrr and check that you are asked to log in.
Troubleshooting
During testing, we used Authelia, Authentik, and Pocket-ID with success. Each provider has been verified to work with autobrr's OIDC implementation.
autobrr starts even when the identity provider is unreachable. OIDC discovery keeps retrying in the background until the provider responds, first after 5 seconds and then backing off to once a minute, so it covers docker-compose setups where the identity provider comes up after autobrr as well as longer outages. Each failed attempt is logged as a warning: could not discover OIDC provider, logins are unavailable until it responds.
Until discovery succeeds, the login page shows the OpenID Connect button disabled with a note that the provider can't be reached, and enables it on its own once the provider responds. The username and password form keeps working in the meantime. With oidcDisableBuiltInLogin set, that form is hidden, so nobody can log in until the provider is back.
Issuer URLs are also tried both with and without a trailing slash, so a slash mismatch between your config and the provider's discovery document is handled automatically.
If you encounter issues, please open a GitHub issue or reach out to us on Discord.
Security Best Practices
- Always run autobrr behind a reverse proxy with TLS enabled
- Make sure the proxy forwards
X-Forwarded-Proto: https. autobrr cannot serve TLS itself and only marks the session cookie as Secure when this header is present; OIDC callback redirects also rely on it. - Use strong passwords for built-in authentication
- Enable MFA in your identity provider when using OIDC
- Regularly update both autobrr and your identity provider
For reverse proxy setup instructions, see: