Skip to content

API key authentication #886

Description

@metaathron

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Home AssistantStuff that is related to home assistant and the integration of servicesarea: config flowRelated to configuration flowfeature requestNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions