robinostlund / volkswagencarnet

A python library for volkswagen carnet
GNU General Public License v3.0
65 stars 36 forks source link

Failed to extract password login form #244

Closed vinnygambiny closed 7 months ago

vinnygambiny commented 7 months ago

I'm unable to login with my account in Canada. I think your parser for connection after the email

this

pw_form["_csrf"] = re.search("csrf_token:\\s*'([^\"']*)'", d.string)[1]
post_action = re.search('"postAction":\\s*"([^"\']*)"', d.string)[1]
client_id = re.search('"clientId":\\s*"([^"\']*)"', d.string)[1]

should be (note the \s)

pw_form["_csrf"] = re.search("csrf_token:\s*'([^\"']*)'", d.string)[1]
post_action = re.search('"postAction":\s*"([^"\']*)"', d.string)[1]
client_id = re.search('"clientId":\s*"([^"\']*)"', d.string)[1]
stickpin commented 7 months ago

Hi @vinnygambiny,

The problem is not a regex. It seems like, in the US you've got a different app version that is pointing to the different API access points. Neither I nor @oliverrahner have access to a US account or US app right now. We might investigate it in the future but for the time being our focus is to recover the functionality after the VW Backend switch. We already discussed this topic here: https://github.com/robinostlund/homeassistant-volkswagencarnet/issues/526#issuecomment-1861522882

If you want to contribute, feel free to share your account credentials with me (stickpins at gmail dot com) and I will try to find a way to check what are the gaps between EU and US implementations. If you decide to share your credentials, please share your mobile phone number as well, so we can easily communicate via WhatsApp or Signal.

vinnygambiny commented 7 months ago

I have do a quick look in the response and it's not find my account. For CA and US is a different clientId and base url

US: https://carnet.vw.com/login
"clientId":"b680e751-7e1f-4008-8ec1-3a528183d215@apps_vw-dilab_com"
baseUrl: 'https://identity.na.vwgroup.io'

CA: https://carnet.vw.ca/login

"clientId":"b43c9f82-b343-463d-8d11-e2d3940ce2a8@apps_vw-dilab_com"
baseUrl: 'https://identity.na.vwgroup.io',

Maybe you can fetch the info from the carnet.vw for US and CA account. I can try later