Skip to content

Conversation

@mdz
Copy link
Owner

@mdz mdz commented Dec 11, 2025

Summary

SmartTub moved new user accounts to their own IDP endpoint, breaking authentication for these accounts. This change migrates from Auth0 to the new SmartTub IDP.

Changes

  • New endpoint: https://api.smarttub.io/idp/signin (was Auth0 /oauth/token)
  • New response format: Tokens now wrapped in {"token": {...}}
  • Account ID: Extracted from custom:account_id claim in ID token (was Auth0 claim)
  • Token refresh: Since no refresh endpoint exists, stores credentials and re-authenticates when token expires (24h)
  • Removed: jwt dependency (manually decode ID token for account_id)

Testing

  • Unit tests updated and passing
  • Live tested against real API
  • Re-authentication flow tested (forced token expiry triggers successful re-auth)

Fixes home-assistant/core#156317

Thanks @xags for the patch

SmartTub moved new accounts to their own IDP endpoint. This change:
- Uses new /idp/signin endpoint instead of Auth0
- Parses new token response format
- Re-authenticates on token expiry (no refresh endpoint available)
- Removes jwt dependency (manually decode ID token for account_id)

Fixes home-assistant/core#156317
@mdz mdz merged commit 8b9460e into main Dec 11, 2025
4 checks passed
@mdz mdz deleted the mdz/fix-auth branch December 11, 2025 05:01
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.

Cannot Authenticate with SmartTub

2 participants