-
-
Notifications
You must be signed in to change notification settings - Fork 23
API key authentication #886
Copy link
Copy link
Open
Labels
Home AssistantStuff that is related to home assistant and the integration of servicesStuff that is related to home assistant and the integration of servicesarea: config flowRelated to configuration flowRelated to configuration flowfeature requestNew feature or requestNew feature or request
Description
Activity
Metadata
Metadata
Assignees
Labels
Home AssistantStuff that is related to home assistant and the integration of servicesStuff that is related to home assistant and the integration of servicesarea: config flowRelated to configuration flowRelated to configuration flowfeature requestNew feature or requestNew feature or request
Checklist
Is your feature request related to a problem? Please describe.
When the Klipper/Moonraker instance has forced authentication enabled, testing the Klipper URL during setup fails with
Error testing klipper url: 401, message='Unauthorized'. The integration currently has no way to authenticate against a Klipper/Moonraker instance that requires an API key, which blocks setup entirely for anyone running Moonraker with [authorization] / trusted-clients restrictions disabled or forced auth enabled.Describe the solution you'd like
Add an optional API key field to the integration's config flow (alongside the existing Klipper URL field). When provided, the integration should send it with each request to the Klipper/Moonraker API as an X-Api-Key header (Moonraker's standard auth header), so the URL test and subsequent polling succeed against an instance with forced authentication. The field should be optional so setups without authentication continue to work unchanged.
Describe alternatives you've considered
Disabling forced authentication / trusted-clients restriction on Moonraker as a workaround — not desirable for security reasons, since it would leave the API open.
Additional context
Moonraker supports API key authentication out of the box (X-Api-Key header), so no changes on the Klipper/Moonraker side would be needed — just support for passing the key through from the integration's config.