fix(web-arm): fix Immich OIDC token auth, offer both login methods #182
No reviewers
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos!182
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/web-arm-immich-oidc-login"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
After deploying #181, signing in via Authelia failed with "Failed to finish oauth". The immich-server log showed the real cause at the token-exchange step:
Immich's OAuth client (
oauth4webapi) authenticates to Authelia's token endpoint withclient_secret_post(secret in the request body), but theimmichclient had notoken_endpoint_auth_methodset, so Authelia applied its confidential-client default ofclient_secret_basicand rejected the exchange. This is the documented Authelia↔Immich setting, and three existing clients here (freescout, synapse, claude-mcp-forgejo) already set it.What
authelia.nix— settoken_endpoint_auth_method = "client_secret_post"on theimmichclient. This is the actual fix for the login failure.immich/default.nix—passwordLogin.enabled = trueandoauth.autoLaunch = false, so the login page now shows both the password form and the "Login with Authelia" button and either can be chosen per login (password login is the admin's fallback when Authelia is unreachable).Trade-off (documented in the module): password login is a parallel path that bypasses the
group:immichauthorization gate. Only admin-created accounts hold a password; OAuth-registered members have none unless they set one.Post-deploy (manual)
The admin account was bootstrapped with an email that does not match the Authelia-asserted email. With
autoRegister = true, a first OAuth login on a mismatched email creates a new, non-admin user instead of linking to the admin (Immich links OAuth→account by normalized email). So after deploy: log in via password as admin → Account Settings → set the email to your Authelia/LDAP email → then "Login with Authelia" links to the same admin account.Relates to #178 (already merged/closed).
Verification
token_endpoint_auth_method,passwordLogin,oauth.autoLaunch) validated against the immich 2.7.5 schema; runtime confirmation is the post-deploy login test above.