[Bug] OIDC Client Secret required when using PKCE flow
Is this a support request?
- This is not a support request
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
My headscale server is using OIDC via PKCE, similar to this:
oidc:
only_start_if_oidc_is_available: true
issuer: "https://auth.example.com"
client_id: "123456789"
client_secret: "" # Same behaviour when the value is absent
pkce:
enabled: true
...PKCE just uses a client ID, not a client secret. This worked in previous versions of Headscale that supported PKCE, but v0.29.4 fails to start with this configuration:
Error: initializing: loading configuration: oidc.client_secret or oidc.client_secret_path is required when oidc.issuer is setRelease notes for v0.29.4 mention
Harden the OIDC callback: [...] an invalid oidc.issuer or a missing oidc.client_id/oidc.client_secret now fails at startup https://github.com/juanfont/headscale/pull/3334
However it should be a valid configuration to have a missing oidc.client_secret when oidc.pkce.enabled is true.
Setting the following configuration works around the issue, and login still works because the value isn't used:
oidc:
...
client_secret: "unused-put-anything-here"
...Expected Behavior
The server should start with a missing oidc.client_secret when oidc.pkce.enabled is true
Steps To Reproduce
See "current behaviour" for config which reproduces
Environment
- OS: AlmaLinux 10
- Headscale version: 0.29.4
- Tailscale version: N/ARuntime environment
- Headscale is behind a (reverse) proxy
- Headscale runs in a container
Debug information
N/A
Source: juanfont/headscale