bimmer_connected icon indicating copy to clipboard operation
bimmer_connected copied to clipboard

http-error 403(forbidden), when logging in to BMW.

Open turribeach opened this issue 4 years ago • 27 comments

since so time (maybe yesterday?), i get an http-error 403(forbidden), when logging in to BMW.

it is a problem with more accounts, not only mine. Location ist Germany therefor "rest of world".

to be sure, i have upgraded to newest bimmerconnect-version

it is no problem, to log in with the original bmw-app

has anyone else this problem?

Originally posted by @demel42 in https://github.com/bimmerconnected/bimmer_connected/discussions/443

turribeach avatar May 27 '22 14:05 turribeach

Getting the same as well. I think BMW may be trying to block this kind of requests. Here is the timeline of events as I saw them (all times are UK time which is currently UTC+01:00):

2022-05-27 08:49:35.549 First error

429 errors every 10 mins:

2022-05-27 09:04:07.499 Connected Drive Warning BMW Connected Drive Account: get_account error: Client error '429 Too Many Requests' for url 'https://cocoapi.bmwgroup.com/eadrax-vcs/v1/vehicles?apptimezone=60.0&appDateTime=1653638646803&tireGuardMode=ENABLED' For more information check: https://httpstatuses.com/429

2022-05-27 10:19:18.044 Final successful refresh.

Errors changed to 403:

2022-05-27 10:24:14.078 Connected Drive Warning BMW Connected Drive Account: get_account error: Client error '403 Forbidden' for url 'https://cocoapi.bmwgroup.com/eadrax-ucs/v1/presentation/oauth/config' For more information check: https://httpstatuses.com/403

The My BMW app is still able to receive updates so clearly the API is rejecting the traffic from this package.

turribeach avatar May 27 '22 14:05 turribeach

I'll double check what the app is doing, either tonight or tomorrow.

rikroe avatar May 27 '22 14:05 rikroe

I put some PR pressure, retweet if you can/care: https://twitter.com/cdturri/status/1530200478881021955

turribeach avatar May 27 '22 14:05 turribeach

Same problem as above. 403 error.

dharvey242 avatar May 27 '22 15:05 dharvey242

+1

hjw2015 avatar May 27 '22 17:05 hjw2015

BMW apparently really does not like using accessing their APIs. They have blocked our specific user agent. While a fix is on the way, I cannot guarantee they won't do the same again soon - its a game of cat and mouse. They surely will monitor what we are doing and try to find other ways to block the library access.

rikroe avatar May 27 '22 17:05 rikroe

Could you make the user agent a parameter so people can easily change it to whatever they want? It will allow users to fix the issue by themselves in the future.

turribeach avatar May 27 '22 17:05 turribeach

I can't understand why BMW try to stop using their API's? Why do they even have an API?

rhoddan avatar May 27 '22 20:05 rhoddan

Actually, they do not have a (public) API. So it's really not surprising that they want to stop people from using the PRIVATE API they're using for the mobile apps.

FlyingDiver avatar May 27 '22 21:05 FlyingDiver

Actually, they do not have a (public) API. So it's really not surprising that they want to stop people from using the PRIVATE API they're using for the mobile apps.

Ok understand. But it would better they release it as public API (make their car owners more happy)

rhoddan avatar May 27 '22 21:05 rhoddan

The percentage of their car owners that care about using anything other than the mobile app approaches zero...

FlyingDiver avatar May 27 '22 21:05 FlyingDiver

the changes of user-agent and x-user-agent seems to work for me.

Thank you for your help and great work.

May I ask one more question? I don't use bimmer_connect directly because I don't use python but translate it into php (for integration into the smarthome solution IP-Symcon). Now you have carried out the changeover to async and made changes in this context, including the introduction of the bmw-session-id and correlation-id. The previous procedure still works - after adjusting the user-agent-ids. My question for understanding is what was the reason for the changes?

demel42 avatar May 28 '22 08:05 demel42

Same here after issuing a: pip3 install --upgrade bimmer_connected

DEBUG:httpx._client:HTTP Request: GET https://cocoapi.bmwgroup.com/eadrax-ucs/v1/presentation/oauth/config "HTTP/1.1 403 Forbidden"

I like y our PHP thought @demel42 , for me the PHP would be used to get the data in Domoticz.

sincze avatar May 28 '22 08:05 sincze

working for me, too 👍

With respect to the cocoapi: yes, it was not meant to be publicly available but accessed by BMW applications via public networks (in contrast to vpn like vehicle to backend telematics channels). The intention from security perspective is to block old MyBMW app releases which might and will become vulnerable over time.

Scotty42 avatar May 28 '22 08:05 Scotty42

@sincze my repo ist here: https://github.com/demel42/IPSymconBMWConnectedDrive there is some stuff inside for integration in IP-Symcon, but yo can see, how it works in php. feel free

demel42 avatar May 28 '22 09:05 demel42

working for me, too 👍

With respect to the cocoapi: yes, it was not meant to be publicly available but accessed by BMW applications via public networks (in contrast to vpn like vehicle to backend telematics channels). The intention from security perspective is to block old MyBMW app releases which might and will become vulnerable over time.

When using: plain bimmerconnected python version, anything I need to change somewhere as well to have it up and running again with the latest bimmerconnected version ? or should that work out of the box?

sincze avatar May 28 '22 09:05 sincze

Many thanks for the quick fix! Working for me again too after I installed from master branch. If you want this update you will need to wait until a new package release is created before you can upgrade directly with pip. In the meantime you can get the latest code from master branch as follows:

git clone https://github.com/bimmerconnected/bimmer_connected.git
cd ./bimmer_connected
pip install -e .

turribeach avatar May 28 '22 10:05 turribeach

It sounds like you've done a great job of fixing the 'user agent' issue. Well done, thank you. When will an updated version of bimmerconnected.exe be ready as I use the CLI not HA?

HeraldCoupe avatar May 28 '22 18:05 HeraldCoupe

If you update to 0.9.2, then it should be fixed for you as well.

rikroe avatar May 28 '22 18:05 rikroe

I applied the update and bimmerconnected.exe was removed and not replaced.

HeraldCoupe avatar May 28 '22 18:05 HeraldCoupe