Skip to content

Support Porsche mobile auth flow and Macan EV data#84

Open
tietjen wants to merge 1 commit intoCJNE:mainfrom
tietjen:codex/mobile-app-auth-flow
Open

Support Porsche mobile auth flow and Macan EV data#84
tietjen wants to merge 1 commit intoCJNE:mainfrom
tietjen:codex/mobile-app-auth-flow

Conversation

@tietjen
Copy link
Copy Markdown

@tietjen tietjen commented Mar 11, 2026

Summary

This updates the library to work with Porsche's current mobile auth flow and restores live vehicle data for newer vehicles such as the Macan EV.

The previous implementation relied on the older native app auth assumptions and older vehicle status endpoints. Porsche now uses a different mobile client flow and current vehicle data is available through app/connect/v1/vehicles/....

What changed

Auth flow

  • switch constants to the current Porsche mobile client configuration
  • add PKCE verifier/challenge handling
  • persist cookies and code_verifier across captcha/login continuation
  • improve captcha extraction for the current Porsche/Auth0 login page
  • handle resume/redirect flow more robustly
  • support passkey enrollment skip during login continuation
  • improve token exchange with code_verifier

Connection handling

  • add support for absolute requests
  • add portal/DCGW request support
  • improve request headers to match Porsche portal/app expectations
  • expose better error details including response body and request URL

Vehicle/account data

  • normalize newer portal/mobile vehicle payloads into the legacy library shape
  • use app/connect/v1/vehicles/... for current overview data
  • support current charging/SoC/range style payloads for newer EVs
  • normalize pairing/connectivity/permissions style nodes for newer vehicles
  • avoid legacy picture endpoint usage where it is no longer relevant

Tested

Tested against a real Porsche account and Macan EV payloads:

  • login including captcha
  • token exchange
  • current overview retrieval
  • live values for:
    • state of charge
    • charging status
    • charging power
    • electric range
    • charging target

Notes

This PR intentionally focuses on the underlying library. Home Assistant integration changes should be handled separately once the updated library is available.

@CJNE
Copy link
Copy Markdown
Owner

CJNE commented Mar 15, 2026

Thank you for this PR, it looks promising!
I tried it and it was not working with older vehicles, for example battery reported 0 for my Taycan 2021.
So we need to figure out a way to make it work with new and old output before we can merge.

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