OIDC SSO
HomeBox supports OpenID Connect (OIDC) authentication, allowing users to log in using external identity providers like Keycloak, Authentik, Authelia, Google, Microsoft, etc.
Basic OIDC Setup
Section titled “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, this must match exactly!HBOX_OIDC_CLIENT_ID: Client ID provided by your OIDC providerHBOX_OIDC_CLIENT_SECRET: Client secret provided by your OIDC provider- If using a reverse proxy, you may need to set
HBOX_OPTIONS_TRUST_PROXY=trueto ensurehttpsis correctly detected. - If you have set
HBOX_OPTIONS_HOSTNAMEensure it uses only the hostname, without the protocol (nothttps://orhttp://)
- Configure Redirect URI: Set the redirect URI in your OIDC provider to
https://yourhomebox.example.com/api/v1/users/login/oidc/callback
Advanced Configuration
Section titled “Advanced Configuration”- Group Authorization: Use
HBOX_OIDC_ALLOWED_GROUPSto restrict access to certain groups. (e.g.HBOX_OIDC_ALLOWED_GROUPS=admins,developers)- Some providers require the
groupsscope to be enabled. Include it inHBOX_OIDC_SCOPESif necessary. (e.g.HBOX_OIDC_SCOPES=openid profile email groups)
- Some providers require the
- Custom Claims: Configure
HBOX_OIDC_GROUP_CLAIM,HBOX_OIDC_EMAIL_CLAIMandHBOX_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 to the OIDC provider for authentication. - Local Login: Set
HBOX_OPTIONS_ALLOW_LOCAL_LOGIN=falseto disable the usage of local credentials. - Email Verification: Set
HBOX_OIDC_VERIFY_EMAIL=trueto require email verification from the OIDC provider before login.
Security Considerations
Section titled “Security Considerations”- Store
HBOX_OIDC_CLIENT_SECRETin a securely, (e.g., environment variable manager or secret management tool). - Use HTTPS for production deployments.
- Configure proper redirects in your OIDC provider, we don’t recommend the use of wildcards.
- Consider setting
HBOX_OIDC_ALLOWED_GROUPSto restrict access to certain groups.