fix: replace WarrantLite SRP login with USER_PASSWORD_AUTH via boto3#162
fix: replace WarrantLite SRP login with USER_PASSWORD_AUTH via boto3#162mfncl9991 wants to merge 1 commit into
Conversation
auth.login() uses WarrantLite's SRP flow which calls get_secret_hash() and breaks with client_secret=None (the new public Cognito app client has no secret). This causes RespondToAuthChallenge to fail with 'Incorrect username or password' for some user accounts, even with valid credentials. Replace with a direct boto3 USER_PASSWORD_AUTH call — the same pattern already used in async_refresh_auth — which bypasses SRP entirely and is not affected by the missing client secret. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Requested impacted user to help test, as at least my HA session is not impacted by this. See #155 (comment) Test instructions: Grab helpers.py from this PR branch and drop it into /config/custom_components/winix/, then restart HA and retry auth. |
|
@iprak thanks for this, there's our smoking gun that kills this PR/hypothesis: SRP is not broken by the secret. Looking at WarrantLite's actual source — it explicitly checks if
The SRP flow is actually correct for users where it works. The question is why it fails for the specific user... with WarrantLite correctly patched, the most likely remaining causes are:
Propose we close this PR and continue troubleshooting via the issue. |
|
Closing. Confirmed issue was with the users password containing special characters. This fix not relevant.
|

Problem
Users are reporting login failures after deploying the v1.5.7 fix:
RespondToAuthChallengeis part of Cognito's SRP auth flow — used byauth.login()via WarrantLite. The root cause is the same as the one already fixed inasync_refresh_auth: WarrantLite callsget_secret_hash()which breaks whenclient_secret=None(the new public client has no secret). This causes the SRP password verifier to be computed or submitted incorrectly for some accounts.The failure is not universal — users with existing sessions that re-auth via the stored credentials may not notice it, but any fresh login (new install, reconfigure, or re-auth for affected accounts) hits it.
Fix
Replace
auth.login()with a direct boto3USER_PASSWORD_AUTHcall — the same pattern already used inasync_refresh_auth— which bypasses SRP entirely and is not sensitive to the missing client secret.References
async_refresh_authfix in fix: update auth and device control for Winix API v1.5.7 #158