You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Docs: KeyAuth now reads the x-api-key header, but examples/docs still advertise 'Authorization: Key' #982
Reality (pfSense-pkg-RESTAPI 2.11_1, pfSense CE 2.9.2)
Auth/KeyAuth.inc detects and reads x-api-key (since 3313e2bc — fix: change KeyAuth to use x-api-key header instead of authorization), but several places still advertise the old Authorization: Key <key> form:
the docs pages and any copy-paste curl examples using Authorization: Key
Symptom for users
Every request returns 401 AUTH_AUTHENTICATION_FAILED with a valid key — easy to misdiagnose as a web-server/header issue (I opened and have now closed PR #983 on that false trail: nginx passes all headers to PHP automatically, confirmed empirically once the header name was fixed: x-api-key: <key> -> 200).
Suggested fix
Grep docs + code comments for the old header form and replace with x-api-key; optionally make KeyAuth accept Authorization: Key as a deprecated fallback for one release to ease migration.
changed the title [-]pfSense >= 2.9 (nginx webConfigurator): Authorization header never reaches PHP — all authenticated requests return 401 AUTH_AUTHENTICATION_FAILED[/-][+]Docs: KeyAuth now reads the x-api-key header, but examples/docs still advertise 'Authorization: Key'[/+]on Nov 23, 2026
Additionally, commit 3313e2b is from a pre-release development version of v2.0.0 before the v2.0.0 package was released. v2 never actually used the Authorization header for key auth in or after the initial release. Authorization is only used for basic and JWT authentication.
Happy to correct any discrepancies if you can point me to the right place.
Activity
[-]pfSense >= 2.9 (nginx webConfigurator): Authorization header never reaches PHP — all authenticated requests return 401 AUTH_AUTHENTICATION_FAILED[/-][+]Docs: KeyAuth now reads the x-api-key header, but examples/docs still advertise 'Authorization: Key'[/+]jaredhendrickson13 commentedon Nov 23, 2026
Can you clarify where you're seeing this discrepancy in the documentation?
The referenced example at
Core/Auth.incdoesn't actually apply to the KeyAuth class as it's overwritten in that subclass:pfSense-pkg-RESTAPI/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Auth/KeyAuth.inc
Line 22 in 9024718
Usage is also correctly stated in documentation examples:
pfSense-pkg-RESTAPI/docs/AUTHENTICATION_AND_AUTHORIZATION.md
Lines 39 to 49 in 9024718
Additionally, commit 3313e2b is from a pre-release development version of v2.0.0 before the v2.0.0 package was released. v2 never actually used the
Authorizationheader for key auth in or after the initial release.Authorizationis only used for basic and JWT authentication.Happy to correct any discrepancies if you can point me to the right place.
Thanks!