Skip to content

fix: handle marketing consent page during authentication#45

Open
irissnap7-design wants to merge 1 commit into
tillsteinbach:mainfrom
irissnap7-design:fix/handle-marketing-consent
Open

fix: handle marketing consent page during authentication#45
irissnap7-design wants to merge 1 commit into
tillsteinbach:mainfrom
irissnap7-design:fix/handle-marketing-consent

Conversation

@irissnap7-design
Copy link
Copy Markdown

Problem

The VW Group identity service may redirect to a marketing consent page (/consent/marketing/) during the OAuth login flow. This causes authentication to fail with either:

  • CSRFError (in myskoda library)
  • Could not find Location in headers, probably due to missing consent (in CarConnectivity)

The existing _handle_consent_form method handles terms-and-conditions pages by POSTing form data, but the marketing consent endpoint only accepts GET requests (returns 405 on POST).

Fix

Added _handle_marketing_consent() method that:

  1. Extracts the callback URL from the consent page's query parameters
  2. Follows it via GET to continue the OAuth flow

The marketing consent page is informational — the callback URL embedded in the query string is the intended continuation point for the OAuth flow.

Testing

Tested against a live MySkoda account that was hitting this consent page on every login attempt. After this fix, authentication completes successfully and vehicle data is fetched.

Related

The VW Group identity service may redirect to a marketing consent page
(/consent/marketing/) during the OAuth login flow. Unlike the
terms-and-conditions page, this endpoint only accepts GET requests
(returns 405 on POST).

This change extracts the callback URL from the consent page's query
parameters and follows it to continue the authentication flow, rather
than failing with a CSRFError or 'missing consent' error.

Fixes authentication failures where users see:
'Could not find Location in headers, probably due to missing consent'

Related: skodaconnect/homeassistant-myskoda#934
@Simon-Spettmann
Copy link
Copy Markdown

Simon-Spettmann commented Mar 25, 2026

Thank you very much for your work, the marketing consent requests have annoyed me many times in the past, as they keep reappearing... I am using the Home Assistant integration skodaconnect/homeassistant-myskoda and just stumbled upon your project and pull request, looking for a fix to the same problem.

Could you please be so kind and explain how exactly the consent request is handled? Does this auto accept, auto decline, or skip the consent pop-up that one would get in the app?

I took a look at your changes, but I'm not familiar enough with the login process and couldn't figure this out on my own.

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