Skip to content

Send validated hardware_id in request_login header (fixes 406 on token refresh)#1269

Merged
fronzbot merged 2 commits into
fronzbot:devfrom
punkgun79:fix-request-login-hardware-id-header
Jul 20, 2026
Merged

Send validated hardware_id in request_login header (fixes 406 on token refresh)#1269
fronzbot merged 2 commits into
fronzbot:devfrom
punkgun79:fix-request-login-hardware-id-header

Conversation

@punkgun79

Copy link
Copy Markdown
Contributor

Description:

/oauth/token rejects requests whose hardware_id header is not a valid UUID with 406 Not Acceptable. request_login() sends login_data["device_id"] (default "Blinkpy") as that header, so every in-session token refresh fails. The header now uses auth.hardware_id, which is guaranteed to be a UUID since #1268.

As offered in #1268 — measurements there: 406 with Blinkpy, 200 with a UUID against the live API. The recent reports in #1217 ("Login endpoint failed" ~90 minutes after a restart, restart temporarily fixes it) match this failure mode: startup uses the OAuth v2 refresh path with a proper UUID in the body, while the in-session refresh sends the rejected header.

Related issue (if applicable): follow-up to #1268, addresses the refresh failures reported in #1217

Checklist:

  • Local tests with tox run successfully PR cannot be meged unless tests pass
  • Changes tested locally to ensure platform still works as intended — refresh grant verified against the live API
  • Tests added to verify new code works

🤖 Generated with Claude Code

Blink rejects non-UUID hardware_id headers on /oauth/token with a 406,
so the device_id default ("Blinkpy") breaks in-session token refresh.
Verified against the live API: 406 with "Blinkpy", 200 with a UUID.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@fronzbot
fronzbot merged commit 2363dcf into fronzbot:dev Jul 20, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants