2.6 KiB
Configure OIDC
HomeBox supports OpenID Connect (OIDC) authentication, allowing users to login using external identity providers like Keycloak, Authentik, Authelia, Google, Microsoft, etc.
::: tip OIDC Provider Documentation When configuring OIDC, always refer to the documentation provided by your identity provider for specific details and requirements. :::
Basic OIDC Setup
-
Enable OIDC: Set
HBOX_OIDC_ENABLED=true. -
Provider Configuration: Set the required provider details:
HBOX_OIDC_ISSUER_URL: Your OIDC provider's issuer URL.- Generally this URL should not have a trailing slash, though it may be required for some providers.
HBOX_OIDC_CLIENT_ID: Client ID from your OIDC provider.HBOX_OIDC_CLIENT_SECRET: Client secret from your OIDC provider.- If you are using a reverse proxy, it may be necessary to set
HBOX_OPTIONS_TRUST_PROXY=trueto ensurehttpsis correctly detected. - If you have set
HBOX_OPTIONS_HOSTNAMEmake sure it is just the hostname and does not includehttps://orhttp://.
-
Configure Redirect URI: In your OIDC provider, set the redirect URI to:
https://your-homebox-domain.example.com/api/v1/users/login/oidc/callback.
Advanced OIDC Configuration
- Group Authorization: Use
HBOX_OIDC_ALLOWED_GROUPSto restrict access to specific groups, e.g.HBOX_OIDC_ALLOWED_GROUPS=admin,homebox.- Some providers require the
groupsscope to return group claims, include it inHBOX_OIDC_SCOPE(e.g.openid profile email groups) or configure the provider to release the claim.
- Some providers require the
- Custom Claims: Configure
HBOX_OIDC_GROUP_CLAIM,HBOX_OIDC_EMAIL_CLAIM, andHBOX_OIDC_NAME_CLAIMif your provider uses different claim names.- These default to
HBOX_OIDC_GROUP_CLAIM=groups,HBOX_OIDC_EMAIL_CLAIM=emailandHBOX_OIDC_NAME_CLAIM=name.
- These default to
- Auto Redirect to OIDC: Set
HBOX_OIDC_AUTO_REDIRECT=trueto automatically redirect users directly to OIDC. - Local Login: Set
HBOX_OPTIONS_ALLOW_LOCAL_LOGIN=falseto completely disable username/password login. - Email Verification: Set
HBOX_OIDC_VERIFY_EMAIL=trueto require email verification from the OIDC provider.
Security Considerations
::: warning OIDC Security
- Store
HBOX_OIDC_CLIENT_SECRETsecurely (use environment variables, not config files). - Use HTTPS for production deployments.
- Configure proper redirect URIs in your OIDC provider.
- Consider setting
HBOX_OIDC_ALLOWED_GROUPSfor group-based access control. :::
::: tip CLI Arguments
If you're deploying without docker you can use command line arguments to configure the application. Run homebox --help for more information.
:::