home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.07k stars 31.09k forks source link

BMW login failure #128598

Closed Maciejul closed 1 day ago

Maciejul commented 1 month ago

The problem

I am attempting to setup the integration first time. I have tried multiple times over the last couple days but I am getting authentication failed error.

I have the MyBMW App working, as well as I can see my car on the bmw connected website just fine. I have change my password to ensure it's up to date but no luck. I tried using all regions as well, but none of them worked. I'm from Canada, and so is my account and car registered to Canadian region.

I have noticed in the log that the URL the authentication module is using, doesnt seem to exist (404) based on the logs.

What version of Home Assistant Core has the issue?

20241002.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

BMW Connected Drive

Link to integration documentation on our website

https://www.home-assistant.io/integrations/bmw_connected_drive/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-10-16 11:34:26.634 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x1480b727f150>,) inside the event loop by integration 'bmw_connected_drive' at homeassistant/components/bmw_connected_drive/config_flow.py, line 54: await auth.login() (offender: /usr/local/lib/python3.12/site-packages/httpx/_config.py, line 149: context.load_verify_locations(cafile=cafile)), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+bmw_connected_drive%22
File "/usr/src/homeassistant/homeassistant/components/bmw_connected_drive/config_flow.py", line 91, in async_step_user
File "/usr/src/homeassistant/homeassistant/components/bmw_connected_drive/config_flow.py", line 54, in validate_input
2024-10-16 11:34:27.689 ERROR (MainThread) [bimmer_connected.api.authentication] MyBMWAuthError due to HTTPStatusError: { "statusCode": 404, "message": "Resource not found" }
2024-10-16 11:34:30.749 ERROR (MainThread) [bimmer_connected.api.authentication] MyBMWAuthError due to HTTPStatusError: invalid_client - Client authentication failed (e.g., login failure, unknown client, no client authentication included or unsupported authentication method)
2024-10-16 11:34:34.556 ERROR (MainThread) [bimmer_connected.api.authentication] MyBMWAuthError due to HTTPStatusError: invalid_client - Client authentication failed (e.g., login failure, unknown client, no client authentication included or unsupported authentication method)

Additional information

No response

home-assistant[bot] commented 1 month ago

Hey there @gerard33, @rikroe, mind taking a look at this issue as it has been labeled with an integration (bmw_connected_drive) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `bmw_connected_drive` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign bmw_connected_drive` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


bmw_connected_drive documentation bmw_connected_drive source (message by IssueLinks)

Meli73 commented 1 month ago

I got this Error:

Logger: bimmer_connected.api.authentication Source: components/bmw_connected_drive/config_flow.py:54 First occurred: October 17, 2024 at 11:06:25 PM (3 occurrences) Last logged: October 17, 2024 at 11:07:00 PM MyBMWAuthError due to HTTPStatusError: invalid_client - Client authentication failed (e.g., login failure, unknown client, no client authentication included or unsupported authentication method)

It's the same Problem ?

rikroe commented 1 month ago

It seems there are some issues.

I will check for more details over the weekend.

robthebold commented 1 month ago

I think I'm getting the same issue. I thought I'd broken something restoring backup of HA to new rasp pi, but it was coincidence, seeing same thing as Meli73 above . . .

Logger: bimmer_connected.api.authentication
Source: components/bmw_connected_drive/config_flow.py:54
First occurred: October 18, 2024 at 1:10:40 PM (4 occurrences)
Last logged: 10:59:51 AM

MyBMWAuthError due to HTTPStatusError: invalid_client - Client authentication failed (e.g., login failure, unknown client, no client authentication included or unsupported authentication method)

North America, HA Core: 2024.10.3

sinanqasha commented 1 month ago

Same issue here. Restored a back-up and now I can't login!

richtj999 commented 1 month ago

I am having same issue - this might be related?

https://g05.bimmerpost.com/forums/showthread.php?p=31550355

rikroe commented 1 month ago

I was only able to confirm that currently authentication to North America is not possible. Rest of world still seems fine.

Unfortunately, I won't have the chance to look into it until next week (traveling).

rikroe commented 1 month ago

@home-assistant rename BMW North America unable to login

mynolix1986 commented 1 month ago

I got the same with the log saying: MyBMWAuthError due to HTTPStatusError: invalid_client - Client authentication failed (e.g., login failure, unknown client, no client authentication included or unsupported authentication method)

S10XtremeNLow commented 1 month ago

Same issue here

joe-colorado commented 1 month ago

Same issue. I had to restore a previous verstion of Homeassistant. Since then i lost the authentication. I removed the app and reinstalled. The issue continues in Homeassistant while logged into the Mini Connected app in NA

bradarussell commented 1 month ago

I’m having the same issue after it working for a long time. It looks like MyBWM login is using a form of captcha now and it looks like the error might be from the login looking for a validation form that isn’t there.

rikroe commented 1 month ago

As @bradarussell just mentioned, BMW have started using hCaptcha to protect their logins. Even if it doesn't show during login in the app, a captcha check is done in the background.

It seems that when no valid captcha token is preset, the login will be denied.

From a very quick check I have no immediate idea how to solve this (except using external captcha solver services which cost money).

nilen98 commented 1 month ago

Same issue here in north america. How much would the external captcha services cost?

robthebold commented 1 month ago

It would be interesting to know if this was the first integration using cloud services to run into this problem. If not, it would be informative to learn if or how it was solved for another integration. I hope the answer is not that the PTBs at hassio get all squeamish about captchas

joe-colorado commented 1 month ago

There is no Captcha on the app or in the browser for the BMW Connected app.

At least I could not find something. The login in NA still fails, even after password change

From: nilen98 @.> Sent: Tuesday, October 29, 2024 10:52 AM To: home-assistant/core @.> Cc: joe-colorado @.>; Comment @.> Subject: Re: [home-assistant/core] BMW North America unable to login (Issue #128598)

Same issue here in north america. How much would the external captcha services cost?

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/128598#issuecomment-2444834555 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AOOJBIEWRIYGZMLBDJYT6ETZ564MJAVCNFSM6AAAAABQEFIDVSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBUHAZTINJVGU . You are receiving this because you commented. https://github.com/notifications/beacon/AOOJBIBQKLW22PAAP576KCTZ564MJA5CNFSM6AAAAABQEFIDVSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTURXE3PW.gif Message ID: @. @.> >

nilen98 commented 1 month ago

Yeah when I log in on the app for myself or on the bmw website, I don't have any captchas currently

nilen98 commented 1 month ago

Actually just relogged into the bmw app, I have a captcha now so that theory is correct. On the website I have no captcha when I logged in the past few times this weekend but the app does. maybe the integration (if we want to avoid the captcha issues) has to be recoded as a web browser type of login instead of mimicking the app? Not sure - just theorizing

pkulak commented 1 month ago

From what I understand, it's mostly heuristic based. I doubt they throw up an actual captcha unless they absolutely have to.

I wonder if instead of a login, the integration could ask for the auth token instead. While less user-friendly, at least someone could log in with a browser and then grab it out of local storage, or wherever they keep it. That would be more secure as well.

nilen98 commented 1 month ago

Thats not a bad idea, I've seen a homebridge integration for nest thermostats work that work and its not too difficult using the chrome developer tools. Under the "using a google account" section could be mimicked for this https://github.com/chrisjshull/homebridge-nest

rikroe commented 1 month ago

I will try using the web access token later. However from just looking at the oauth scopes, the app has much more scopes requested than the web page.

LogicAnalysis commented 1 month ago

Same issue here :(

stefankoenders commented 1 month ago

Same issue for REST_OF_WORLD over here on multiple accounts.

rikroe commented 1 month ago

Some news:

joe-colorado commented 1 month ago

Thank you for your effort to figure this out

From: Richard Kroegel @.> Sent: Wednesday, October 30, 2024 1:49 PM To: home-assistant/core @.> Cc: joe-colorado @.>; Comment @.> Subject: Re: [home-assistant/core] BMW North America unable to login (Issue #128598)

Some news:

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/128598#issuecomment-2448226419 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AOOJBIDBZJBXTLDX2W5UQTDZ6EZ37AVCNFSM6AAAAABQEFIDVSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBYGIZDMNBRHE . You are receiving this because you commented. https://github.com/notifications/beacon/AOOJBICADDZXENENH63F7KDZ6EZ37A5CNFSM6AAAAABQEFIDVSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUR5T4HG.gif Message ID: @. @.> >

naseemr commented 1 month ago

same issue here, hope someone able to fix it soon.

nilen98 commented 1 month ago

Yeah I do want to say thank you to @rikroe and anyone else who helped with this integration, its honestly my favorite in Home assistant

gershte commented 3 weeks ago

I still cannot log in to this application from Canada. I see that the issue seems to be resolved, but I don't know how to fix this problem in my system. Could someone please explain to me how to do this?

Screenshot 2024-11-07 151339

tmorris0221 commented 3 weeks ago

I seen this as resolved, will we have to wait for 11.1 release for implementation?

rikroe commented 3 weeks ago

Only the issue in the library itself is resolved. For Home Assistant, it's required that #129667 gets merged as well.

drichfsu commented 3 weeks ago

I seen this as resolved, will we have to wait for 11.1 release for implementation?

I have installed the latest version 2024.11.1 and I'm still seeing the same autthentication issues.

Screenshot 2024-11-08 at 4 22 17 PM Screenshot 2024-11-08 at 4 23 00 PM Screenshot 2024-11-08 at 4 23 19 PM
robthebold commented 3 weeks ago

I have installed the latest version 2024.11.1 and I'm still seeing the same autthentication issues.

When I checked just now, the merge request cited in @rikroe's post just before yours looks like it's still under review, so I wouldn't expect to see the fix for at least one more dot version of HA.

tmorris0221 commented 2 weeks ago

Do we know who has to review in order to get it in the next release?

robthebold commented 2 weeks ago

Do we know who has to review in order to get it in the next release?

In the HomeAssistant core PR (where you're @ mentioned, BTW) the review is waiting for a review by @frenck who has been assigned by @frenck to review it. I'd guess he's either really busy or maybe a Mercedes-Benz guy. Ironic smiley face

S10XtremeNLow commented 1 week ago

@frenck - how often do you review merge requests?

frenck commented 1 week ago

@S10XtremeNLow Not sure how to answer your question, as it is an odd quantifier. I review probably around 150-250 PRs a week. But not sure how that matter to this issue.

S10XtremeNLow commented 1 week ago

@S10XtremeNLow Not sure how to answer your question, as it is an odd quantifier. I review probably around 150-250 PRs a week. But not sure how that matter to this issue.

Good point. I guess I was trying to gauge when you thought you may be able to review the merge request and we could anticipate when it would be part of the next version release.

However, your last comment makes me think the merge request is missing something to proceed to next step. Granted I’m not familiar with the process, does a @rikroe need anything else or just waiting for your review?

disregard, saw your most recent reply. Thanks for the clarification.

frenck commented 1 week ago

Do we know who has to review in order to get it in the next release?

In the HomeAssistant core PR (where you're @ mentioned, BTW) the review is waiting for a review by @frenck who has been assigned by @frenck to review it. I'd guess he's either really busy or maybe a Mercedes-Benz guy. Ironic smiley face

I actually drive a Peugeot 😉

Anyway, that PR needs core review/discussion, as the PR does include external javascript into the Home Assistant frontend. I want to validate that with the core team in the next architectural meeting later this week.

This has been discussed on the discussion on Discord on this PR and with Richard directly in DM as well.

../Frenck

rikroe commented 1 week ago

@home-assistant rename BMW login failure

rikroe commented 1 week ago

As per https://github.com/bimmerconnected/bimmer_connected/issues/671 (and verified myself), BMW now enforces a captcha for rest_of_world as well.

The same functionality of #129667 (with one changed variable) would be applicable as well (verified working in a quick-and-dirty test).

pbrooks29 commented 1 week ago

Yes, its been a problem in ROW (from Australia) for a day or two. image (core 2024.10.3)

GerhardSundt commented 1 week ago

Having the same problem in Europe (ROW). Core 2024.11.2.

themo83 commented 1 week ago

Same problem in Europe/Austria (ROW). Core 2024.11.2.

miraixyz commented 1 week ago

I am glad its not just me. Subbing to thread.

groove200 commented 1 week ago

Same for me in the uk , watching progress with interest

paulhorbal commented 1 week ago

Currently in low earth orbit. Issue confirmed up here, too.

On Tue, Nov 19, 2024 at 5:06 PM groove200 @.***> wrote:

Same for me in the uk , watching progress with interest

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/128598#issuecomment-2486930026, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXOGX7LGHFRNGCVSCVJ4A32BO77ZAVCNFSM6AAAAABQEFIDVSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBWHEZTAMBSGY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

purewhitedesign commented 1 week ago

Same issue! After installing a backup (from a few days ago) I cannot reauthorize the integration. So I deleted it and tried it again. No chance, I got an error "Invalid authentication". I am located in Austria, rest of the world. No captcha needed to login with app or browser.

schweiger2 commented 1 week ago

Just as a hint. In ioBroker the adapter was modified and integrates the captcha. See:

BMW ConnDrive iobroker

charlas commented 1 week ago

Same here, thought was because I've just changed cars, and was in a loop as removed old one from account, and added new one. But seems to be a larger issue from the looks (Europe region, so ROW)

RalfEs73 commented 1 week ago

Same problem in Europe.