alandtse / alandtse/alexa_media_player

[Bug]: Alexa Media Player - 401 Unauthorized on Re-authentication After Integration Reload

Aperta
#3,547 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
alexapy bug
Lingua principale
Python
Stelle
2k
Fork
345
Merge medio
8g 15h
PR unite (30g)
4

Descrizione

### Describe the bug

After reloading the Alexa Media Player integration to fix a separate phone device registration issue, the integration cannot re-authenticate to Amazon, even though direct login to Amazon works and all credentials are correct. Every attempt to set up the integration results in immediate "401: Unauthorized" error.

### To Reproduce

1. Go to Settings → Devices & Services
2. Click Create Integration and search for "Alexa Media Player"
3. Click Alexa Media Player
4. Enter email: youremailID
5. Enter password : yourpassword
7. Leave Authenticator App Key empty (2FA disabled)
8. Enter Local network URL: http://XXXXXXXXX
9. Enter Public URL: https://YYYYYYYYYYYYYYYYYYYY.ui.nabu.casa/
10. Click Submit
11. See "401: Unauthorized" error immediately during authentication flow

### Expected behavior

Amazon **Actionnable Notifications** are no longer working

### Screenshots

What Was Working:

✅ Alexa Media Player integration fully functional
✅ Phone notifications worked
✅ Actionable notifications worked
✅ All automations using Alexa TTS worked

What Changed:
Reloaded the Alexa Media Player integration via HA UI to refresh device credentials after phone was re-registered. The reload changed the entry ID and generated a new webhook URL, invalidating cached authentication.

Troubleshooting Steps Tried (all failed):

1. Deleted integration & restarted HA (multiple times)
2. Reinstalled Alexa Media Player via HACS
3. Reinstalled Alexa app on phone
4. Verified Amazon credentials work directly
5. Tested without 2FA
6. Multiple HA restarts
7. Cleared browser cache

### Home Assistant Version

2026.8

### Alexa Media Player Version

5.15.7

### Alexa Media Player API library Version

unable to determine from logs

### Have you entered a 52-character key for Amazon 2SV via Authenticator App login?

No

### Is the HA core integration Alexa Devices installed?

No

### Amazon Domain

amazon.com (US)

### Amazon Domain (if Other)

_No response_

### Debug Logs (alexa_media & alexapy)

```text
Debug logs can be provided if needed for investigation.
```

### Additional context

Hypothesis:
The integration reload invalidated cached auth tokens, and the integration cannot recover. Possible causes:

- Corrupted auth cache that's unrecoverable
- Amazon's unofficial API changed
- Corrupted stored config preventing new auth attempts

Key Finding:
This is a regression — the integration worked perfectly before the reload. The reload itself appears to have broken the ability to re-authenticate.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.