itchannel / fordpass-ha

Fordpass integration for Home Assistant
309 stars 55 forks source link

Can't login: 403 Client Error: Forbidden for url: https://login.ford.com #488

Open frankie-boy-hgv opened 5 months ago

frankie-boy-hgv commented 5 months ago

2024-05-07 15:47:24.506 WARNING (MainThread) [custom_components.fordpass] 403 Client Error: Forbidden for url: https://login.ford.com/xxxxxxxxxxxxxxxxxxx/B2C_1A_SignInSignUp_EN-GB/SelfAsserted?tx=StateProperties=xxxxxxxxxxxxxxxxxxx&p=B2C_1A_SignInSignUp_en-AU 2024-05-07 15:47:24.506 WARNING (MainThread) [custom_components.fordpass] Error communicating with FordPass for xxxxxxxxxxxxxxxxxxx 2024-05-07 15:47:24.506 WARNING (MainThread) [custom_components.fordpass] Returning Stale data to prevent unavaliable status 2024-05-07 15:47:24.507 ERROR (MainThread) [custom_components.fordpass] Error fetching fordpass data: Error communicating with FordPass for xxxxxxxxxxxxxxxxxxx

Ford changed things again?

JVTEAM commented 5 months ago

Same issue here. Thought it was because I upgrade the Core, but it seems just bad timing.

frankie-boy-hgv commented 5 months ago

Same here, right after updating to 2024.5.2 (from 2024.5.1)

JVTEAM commented 5 months ago

Same here, right after updating to 2024.5.2 (from 2024.5.1)

Ok, so it is core related.

keller1982 commented 5 months ago

Seems like it.

I didn't change the core, I still have 2024.4.2 and I have the same error.

400HPMustang commented 5 months ago

Same issue on 2024.5.1

JanosBerke commented 5 months ago

Hi,

It is the same here, Ford must have changed something.

D0NY3NK0 commented 5 months ago

Same issue here.

AndreiGavriliu commented 5 months ago

Same here. I thought I got banned or something

Picard16 commented 5 months ago

Same here in Germany with my Kuga. Last successful sync was yesterday, 2024-05-06, at 16:20 CEST Europe.

EnDoubleU commented 5 months ago

Since 2024.5.2 the FordPass integration cannot initalize anymore. Logfile says: "Error fetching fordpass data: Error communicating with FordPass for vin number" And since 16:10:07 of today (may 7) the "403 Client Error: Forbidden for url: https://login.ford.com/..." error.

AlanJ500 commented 5 months ago

Issue isn't core, it's on Fords side for this one. Maybe it will resolve itself? Or maybe some tweaks will need to be made.

clabern commented 5 months ago

Same issue here, started around 9:31AM eastern.

0sAND1s commented 4 months ago

Hi! The error I get in the log starting today is below. Thanks for any idea.

[139683214187072] 403 Client Error: Forbidden for url: https://login.ford.com/GUID-REMOVED/B2C_1A_SignInSignUp_EN-GB/SelfAsserted?tx=StateProperties=eyJUSUQiOiIxY2ZkMGNhZS1iMWQ1LTQ3ZTQtYTc1Yi1jNjMwZDUyOTEyOGIifQ&p=B2C_1A_SignInSignUp_en-AU

alessandro1898 commented 4 months ago

Same issue for me in Italy with a Ford Puma. Can't login.

bmwhitetx commented 4 months ago

Have not updated anything HA related in a month. On Core 2024.4.3. Got this error today. Can't be HA related.

dizzybro commented 4 months ago

Same here, can't login as of 5-7-2024

itchannel commented 4 months ago

Looks like an API change to the login flow. Will try and take a look later today. In the meantime I recommend people disable the integration in HA until I can fix it :)

domolys commented 4 months ago

Still running core 2024.1.6 and having the same issue

scotty1395 commented 4 months ago

Working again for me in Australia. Entities became available about 90 minutes ago without a HA restart.

frankie-boy-hgv commented 4 months ago

Not working here yet.

0sAND1s commented 4 months ago

I also noticed that the official FORDPASS app now shows some details that were previously unavailable/removed:

itchannel commented 4 months ago

Initial looks it seems Ford have enabled Akamai Bot Manager in a fairly aggressive mode to prevent people calling the API Login from tools other than Fords own app.

This probably isn't going to be a quick fix. It does look like they have officially launched their developer api that people could use but only available in Northern America and severely limited so I'm unable to test or implement that.

Will keep playing and seeing if there's away round it.

AlanJ500 commented 4 months ago

@itchannel The new FordPass Connect API in the developer program does have feature parity according to the Ford team in charge of it. The only difference is that anyone who wants to use it must register their FordPass account to use it and prevent lockouts.

The Ford team has been attempting to reach out to you to get this functional / supported.

ve6rah commented 4 months ago

You say only available in North America, in fact the website specifies only available in the US, so not even Canada! That said, if I have to create a developer account to get things working, I'm willing to do that, but if it's not even going to work in my country, that's severely disappointing! And less than a week after I bought my truck!

If the Ford team is really trying to reach out to you though, absolutely take this opportunity! That's exactly what we've been waiting for! Anything they can do to help make this official would go a very long way to helping all of us.

AlanJ500 commented 4 months ago

^ The Ford team is. I don't speak for them, however my interactions with the team is that they do want to enable this type of functionality but also balance security concerns and legal concerns. The developer program is new, which is why it's US only right now. I am sure that will change over time.

mclever commented 4 months ago

I signed up for a dev account, put n/a for company, and was poking around. From https://developer.ford.com/use-cases/connect-ford-to-daily-tracking-apps it says that the FordConnect API is available globally except for China. You can connect your dev account to Fordpass account and get API creds.

400HPMustang commented 4 months ago

You can connect your dev account to Fordpass account and get API creds.

Are you able to log in to the fordpass integration with those creds or does it require a different login URL?

ve6rah commented 4 months ago

I signed up for a dev account, put n/a for company, and was poking around. From https://developer.ford.com/use-cases/connect-ford-to-daily-tracking-apps it says that the FordConnect API is available globally except for China. You can connect your dev account to Fordpass account and get API creds.

That's the tracking API only, that doesn't include things like unlocking or locking, remote start, etc. Scroll to the bottom of that page that you linked and will show the actual connect API separate and listed as USA only

jonepet commented 4 months ago

For me the integration started working again if I change all the variables related to locale and the ford_application_id parameter to the same as in the URL provided by ford website (in my language).

The integration seems to be mixing australia and GB and US when used in EU&Europe mode. In my case replaced AUS => NOR, login.ford.com => login.ford.no, en-GB => nb-NO, 5C80A6BB-CF0D-4A30-BDBF-FC804B5C1A98 => 260ea066-aa5e-4344-995d-b8a3d7dd0fca

Maybe the issue is about each country having their own settings?

AlanJ500 commented 4 months ago

@jonepet that appears to be a simple change. in my HA instance my integration shows as cloud dependent so not sure I can test that out myself. Any tips there?

SquidBytes commented 4 months ago

@itchannel The new FordPass Connect API in the developer program does have feature parity according to the Ford team in charge of it. The only difference is that anyone who wants to use it must register their FordPass account to use it and prevent lockouts.

The Ford team has been attempting to reach out to you to get this functional / supported.

How do you know they've been trying to reach out? Do you have a point of contact?

kernest commented 4 months ago

For me the integration started working again if I change all the variables related to locale and the ford_application_id parameter to the same as in the URL provided by ford website (in my language).

The integration seems to be mixing australia and GB and US when used in EU&Europe mode. In my case replaced AUS => NOR, login.ford.com => login.ford.no, en-GB => nb-NO, 5C80A6BB-CF0D-4A30-BDBF-FC804B5C1A98 => 260ea066-aa5e-4344-995d-b8a3d7dd0fca

Maybe the issue is about each country having their own settings?

Did the same in Denmark. Changed the url to login.ford.dk and lang to DA-DK. Integration now works again.

daath commented 4 months ago

Did the same in Denmark. Changed the url to login.ford.dk and lang to DA-DK. Integration now works again.

Can you tell me exactly what you did? I assume edit /custom_components/fordpass/fordpass_new.py and change FORD_LOGIN_URL = "https://login.ford.com"? Anything else?

Thanks :)

kernest commented 4 months ago

Did the same in Denmark. Changed the url to login.ford.dk and lang to DA-DK. Integration now works again.

Can you tell me exactly what you did? I assume edit /custom_components/fordpass/fordpass_new.py and change FORD_LOGIN_URL = "https://login.ford.com"? Anything else?

Thanks :)

fordpass_new.py

L46: "UK&Europe": "DA-DK", L50: "UK&Europe": "DNK", L63: FORD_LOGIN_URL = "https://login.ford.dk"

Also change following, not sure if needed: L151: "Origin": "https://login.ford.dk", L267: url1 = f"https://login.ford.dk/ *****

daath commented 4 months ago

Thanks @kernest - worked a treat after a restart :) Didn't test start/lock/unlock but all the sensors are there and updated :)

compoundbow83 commented 4 months ago

L46: "UK&Europe": "DA-DK", L50: "UK&Europe": "DNK", L63: FORD_LOGIN_URL = "https://login.ford.dk"

Thank you @kernest ist works also in Germany with this changes in the fordpass_new.py:

L46: "UK&Europe": "DE-DE", L50: "UK&Europe": "DE", L63: FORD_LOGIN_URL = "https://login.ford.de"

the other lines in don´t change. And with this changes I can login und the sensors are back.

frankie-boy-hgv commented 4 months ago

Did the same in Denmark. Changed the url to login.ford.dk and lang to DA-DK. Integration now works again.

Can you tell me exactly what you did? I assume edit /custom_components/fordpass/fordpass_new.py and change FORD_LOGIN_URL = "https://login.ford.com"? Anything else? Thanks :)

fordpass_new.py

L46: "UK&Europe": "DA-DK", L50: "UK&Europe": "DNK", L63: FORD_LOGIN_URL = "https://login.ford.dk"

Also change following, not sure if needed: L151: "Origin": "https://login.ford.dk", L267: url1 = f"https://login.ford.dk/ *****

Works with Dutch settings! Awesome, thnx! NL-NL NL login.ford.nl

I changed all 5 lines.

AlanJ500 commented 4 months ago

@itchannel The new FordPass Connect API in the developer program does have feature parity according to the Ford team in charge of it. The only difference is that anyone who wants to use it must register their FordPass account to use it and prevent lockouts. The Ford team has been attempting to reach out to you to get this functional / supported.

How do you know they've been trying to reach out? Do you have a point of contact?

I do, I cant say how I know due to an NDA but just that they have. I do have a point of contact however I would rather not post it in here for all to see. I can DM it.

dizzybro commented 4 months ago

Do any of these workarounds work for people in the US?

BrttClne22 commented 4 months ago

I'd be interested if anyone found an angle on this solution for North America. Most of the references seem correct by default for us. I did find a few EN-AU references in the url strings but replacing them doesn't seem to change anything

kevinpato72 commented 4 months ago

Ok in France too ! FR-FR and login.ford.fr ;)

AlanJ500 commented 4 months ago

Waiting for a USA fix as well. Attempting to change the short code, and control codes don't resolve the issue like in the other countries.

cpw commented 4 months ago

Doesn't work for Canada afaict - tried CA as the locale_short_lookup and EN-CA for the locale_lookup as well as login.ford.ca for the FORD_LOGIN_URL. It looks like they haven't rolled this out worldwide - only to North America - so if you redirect yourself to the non-NA endpoints it'll work for you.

JanosBerke commented 4 months ago

Did the same in Denmark. Changed the url to login.ford.dk and lang to DA-DK. Integration now works again.

Can you tell me exactly what you did? I assume edit /custom_components/fordpass/fordpass_new.py and change FORD_LOGIN_URL = "https://login.ford.com"? Anything else? Thanks :)

fordpass_new.py

L46: "UK&Europe": "DA-DK", L50: "UK&Europe": "DNK", L63: FORD_LOGIN_URL = "https://login.ford.dk"

Also change following, not sure if needed: L151: "Origin": "https://login.ford.dk", L267: url1 = f"https://login.ford.dk/ *****

Line 267 needs localization everywhere and works after a restart :) Thanks a ton!!!!

alespouzar commented 4 months ago

Necessary updates to make it work in Czechia:

locale_lookup = {
    "UK&Europe": "cs-CZ",
    ...

locale_short_lookup = {
    "UK&Europe": "CZ",
    ...

FORD_LOGIN_URL = "https://login.ford.cz"
jonepet commented 4 months ago

If I open the login page on ford.com I get this URL: https://login.ford.com/4566605f-43a7-400a-946e-89cc9fdb0bd7/B2C_1A_SignInSignUp_en-US/oauth2/v2.0/authorize?redirect_uri=https%3A%2F%2Fwww.ford.com%2Flogin%2F&response_type=code&state=%7B%22policy%22%3A%22email_susi_policy%22%2C%22lang%22%3A%22en_us%22%2C%22state%22%3A%22%22%2C%22queryHash%22%3A%22%22%2C%22forwardUrl%22%3A%22aHR0cHM6Ly93d3cuZm9yZC5jb20v%22%7D&client_id=98569d7d-cfed-4ede-a134-875acc6e97d1&scope=98569d7d-cfed-4ede-a134-875acc6e97d1%20openid&code_challenge=fpsAzu3xyxsaYCiZt4nhysm7tZGnes-iMQhzADh0rko&code_challenge_method=S256&ui_locales=en-US&template_id=Ford-MFA-Authentication&ford_application_id=CCCA9FB8-B941-46AD-A89F-F9D9D699DD68&country_code=USA&language_code=en-US

The codes should be USA and en-US, but keep in mind there are several places in the fordpass_new.py where the lookup tables are not used, but instead hard codes into the URLs.

I would also suspect the problem could be they have changed the application ID also, as I had to change it too for it to work. It is also possible the application ID for the app and the website is different, but with GDPR it is possible they are removing data sparing between the different regions so this has to be correct to work. The application ID I get on ford.com is not the same as for ford.no.

Picard16 commented 4 months ago

Germany: I changed L44: "DE-DE" (not L46 in my file for whatever reason), L50: "DE", L63: "...de", L151: "...de", L267: "...de". When I tried to add the FordPass integration again (I disabled it after the errors appeared), I got no Login-Error anymore, but I got the error in a popup: "No vehicles on account or all are configured already" and the integration was not activated. Of course my car is still in the FordPass app on my smartphone. Thanks in advance for any ideas! Update 09.05.24 11:00 CEST: Updated to 1.68-Beta

benk016 commented 4 months ago

I highly suspect they made a change to the North America servers that broke this. It only broke for everyone else because of the hard-coded URL's, and fixing that manually is allowing connections again because those systems haven't had the change yet.

Max112233445566 commented 4 months ago

Germany: L44: "UK&Europe": "DE-DE", L63: FORD_LOGIN_URL = "https://login.ford.de" L147: urlp = f"{FORD_LOGIN_URL}/4566605f-43a7-400a-946e-89cc9fdb0bd7/B2C_1ASignInSignUp{self.country_code}/SelfAsserted?tx={transId}&p=B2C_1A_SignInSignUp_de-DE"

serlinGi commented 4 months ago

for ITALY: L44: it-IT L50: IT L63: https://login.ford.it

for now is OK

Thanks 👍