Configuring Providers
Authentication providers are configured via theAUTH_PROVIDERS environment variable. Multiple providers can be enabled by separating them with commas.
.env
credentials- Username/password authentication (default)oidc- OpenID Connect / OAuth2ldap- LDAP directory authentication
Credentials Authentication
The default authentication method using username and password stored in Homarr’s database.Configuration
.env
Must include
credentials to enable this provider.How long user sessions remain valid. Accepts duration strings like
30d, 7d, 12h.Creating Users
Users are created through the Homarr web interface after initial setup. The first user created becomes an administrator.Password Management
Passwords are securely hashed using bcrypt with individual salts. See CLI Commands for password reset options.Security Features
- Passwords hashed with bcrypt
- Individual salts per user
- Session-based authentication
- Configurable session expiry
- Usernames automatically converted to lowercase
OIDC (OpenID Connect)
Connect Homarr to your existing SSO provider like Authentik, Authelia, Keycloak, or any OIDC-compliant provider.Configuration
Addoidc to AUTH_PROVIDERS and configure the following variables:
.env
Required Parameters
The OIDC issuer URL. This is typically your identity provider’s base URL.Examples:
- Authentik:
https://authentik.example.com/application/o/homarr/ - Authelia:
https://authelia.example.com - Keycloak:
https://keycloak.example.com/realms/master
The client ID registered with your OIDC provider.
The client secret provided by your OIDC provider.
Display name for the OIDC login button.
Optional Parameters
Automatically redirect to OIDC provider on login page, skipping the provider selection.
OAuth scopes to request from the provider.
The attribute name in the ID token that contains user groups.
Override which attribute to use for the username. By default, uses
preferred_username or name.Force the use of the userinfo endpoint instead of the ID token.
Allow linking OIDC accounts to existing accounts with the same email address.
Provider-Specific Examples
- Authentik
- Authelia
- Keycloak
.env
- Create a new OAuth2/OpenID Provider
- Set Redirect URI:
https://homarr.example.com/api/auth/callback/oidc - Add scopes:
openid,email,profile,groups - Copy Client ID and Secret to your
.env
Troubleshooting OIDC
www-authenticate error with FusionAuth
www-authenticate error with FusionAuth
This is a known issue with some providers. The error is automatically handled in Homarr.See: GitHub Issue #2690
Groups not syncing
Groups not syncing
Verify
AUTH_OIDC_GROUPS_ATTRIBUTE matches your provider’s group claim name:- Check your ID token structure
- Common values:
groups,roles,memberOf - Update the environment variable to match
Redirect URI mismatch
Redirect URI mismatch
Ensure your OIDC provider has the correct redirect URI registered:
LDAP Authentication
Integrate with existing LDAP directories like Active Directory, OpenLDAP, or FreeIPA.Configuration
Addldap to AUTH_PROVIDERS and configure the following:
.env
Required Parameters
LDAP server URI. Use
ldap:// for unencrypted or ldaps:// for TLS.Distinguished Name (DN) of the service account used for LDAP bind operations.
Password for the LDAP bind DN.
Base DN for user and group searches.
Optional Parameters
LDAP search scope. Options:
base, one, sub.base- Only the base DNone- One level below base DNsub- Full subtree search
LDAP attribute containing the username.
LDAP attribute containing the user’s email address.
Additional LDAP filter for user searches.
LDAP object class for groups.
Attribute in group objects that lists members.
User attribute that matches the group member attribute.
Additional LDAP filter for group searches.
Provider-Specific Examples
- OpenLDAP
- Active Directory
- FreeIPA
.env
Troubleshooting LDAP
Connection refused
Connection refused
- Verify LDAP server is reachable:
telnet ldap.example.com 389 - Check firewall rules
- Ensure correct URI format:
ldap://orldaps://
Bind failed
Bind failed
- Verify bind DN is correct
- Test credentials manually:
- Check for special characters in password (escape if needed)
User not found
User not found
- Verify username attribute matches your LDAP schema
- Check search base is correct
- Increase search scope to
subif users are in nested OUs - Test search manually:
Multiple Providers
You can enable multiple authentication providers simultaneously:.env
Session Management
Session duration for all authentication providers.
URL to redirect users after logout.
Next Steps
- CLI Commands - Manage users and reset passwords
- Environment Variables - Complete variable reference
- Database Configuration - Set up your database
