When using the username/password web authentication flow (with MFA enabled), calling refresh_tokens() can fail with:
EcobeeAuthUnknownError: Unexpected response after login (landed at https://auth.ecobee.com/u/custom-prompt/...)
Reproduction:
from pyecobee import Ecobee
config = {
ECOBEE_USERNAME: "your@email.com",
ECOBEE_PASSWORD: "yourpassword",
}
ecobee = Ecobee(config=config)
ecobee.refresh_tokens() # raises EcobeeAuthUnknownError
Additional Details:
- The library successfully posts credentials via
request_tokens_web().
- It then lands on an Auth0
/u/custom-prompt/ page.
_handle_post_password_response() has no matching case for this path and raises EcobeeAuthUnknownError.
- There is currently no handling for
custom-prompt paths in const.py.
This results in failures in downstream projects (e.g. Home Assistant’s ecobee integration shows a generic “unexpected error”)
Environment:
- python-ecobee-api version: 0.4.1 (master branch)
- Triggered via standalone usage and via Home Assistant 2026.7.0 ecobee integration
Related: home-assistant/core#170439
When using the username/password web authentication flow (with MFA enabled), calling
refresh_tokens()can fail with:Reproduction:
Additional Details:
request_tokens_web()./u/custom-prompt/page._handle_post_password_response()has no matching case for this path and raisesEcobeeAuthUnknownError.custom-promptpaths inconst.py.This results in failures in downstream projects (e.g. Home Assistant’s ecobee integration shows a generic “unexpected error”)
Environment:
Related: home-assistant/core#170439