evcc icon indicating copy to clipboard operation
evcc copied to clipboard

BMW/Mini: UI login flow broken

Open unl0ck opened this issue 1 year ago • 43 comments

Describe the bug

i got login required, error

Image

Steps to reproduce

1.click on mini 2. try to connect 3. ...

Configuration details

added client-id

Log details

[providerauth] DEBUG 2025/12/03 16:30:30 login request for: 
[providerauth] DEBUG 2025/12/03 16:30:31 login request for:

What type of operating system or environment does evcc run on?

Docker container

External automation

  • [x] I have made sure that no external automation like HomeAssistant or Node-RED is active or accessing any of the mentioned devices when this issue occurs.

Nightly build

  • [ ] I have verified that the issue is reproducible with the latest nightly build

Version

0.211.0

unl0ck avatar Dec 03 '25 15:12 unl0ck

@andig same issue here with BMW

[oauth-dca330af] TRACE 2025/12/03 16:42:04 POST https://customer.bmwgroup.com/gcdm/oauth/token
[oauth-dca330af] TRACE 2025/12/03 16:42:04 client_id=xxxxxxxc&code_verifier=tln8NTwyOI8L9EEsQaeq0TnnYHDrWwEs4wan9-ncq94&device_code=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJodHRwczovL2Zvcmdlcm9jay1ibHVlLnByb2QtZ2NkbS5ldS1jZW50cmFsLTEuYXdzLmNsb3VkLmJtdzo0NDMvYW0vb2F1dGgyIiwibmJmIjoxNzY0Nzc2NTE0LCJ1c2VyX2NvZGUiOiJxeG9lYUc2aiIsImlzcyI6Imh0dHBzOi8vZm9yZ2Vyb2NrLWJsdWUucHJvZC1nY2RtLmV1LWNlbnRyYWwtMS5hd3MuY2xvdWQuYm13OjQ0My9hbS9vYXV0aDIiLCJleHAiOjE3NjQ3NzY4MTQsImlhdCI6MTc2NDc3NjUxNCwianRpIjoiNDYzM2UzZTktYzI4Ny00OWJkLTkzYmEtYjcwNTJiYjZkNDk1In0.849jMr6WaMSLvGznkdzlFuGL1lbC1N97sQx6hp0lpzs&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code&scope=authenticate_user+openid+cardata%3Astreaming%3Aread+cardata%3Aapi%3Aread -- {"error_description":"The user has not yet completed authorization","error":"authorization_pending"}

{"error_description":"The user has not yet completed authorization","error":"authorization_pending"}

PTiTDaV avatar Dec 03 '25 15:12 PTiTDaV

Same issue with BMW:

[oauth-ec27569a] ERROR 2025/12/03 17:22:28 error retrieving token: oauth2: "invalid_client" "Client authentication failed"

SDR3078 avatar Dec 03 '25 16:12 SDR3078

{"error_description":"The user has not yet completed authorization","error":"authorization_pending"}

The error message conveys the exact problem.

andig avatar Dec 03 '25 16:12 andig

@andig the issue is that the authentication window doesn't open. It reloads the EVCC window

PTiTDaV avatar Dec 03 '25 16:12 PTiTDaV

Can you share a video or look into the browser console what's going on? I can't reproduce this :O

andig avatar Dec 03 '25 16:12 andig

https://github.com/user-attachments/assets/8cd3b508-c11f-411b-96dc-06e06634402e

PTiTDaV avatar Dec 03 '25 16:12 PTiTDaV

it seems to try to open http://10.0.0.11:7070/providerauth/login?id=cf5fdaf6-xxxx-4888-8e8d-2bd86bd033c6-507f1b6f

Image

PTiTDaV avatar Dec 03 '25 17:12 PTiTDaV

@naltatis it seems hamburger oauth login returns empty url. I'm not sure why yet. But if that happens- could we raise an error instead of doing nothing?

@PTiTDaV what's in /api/state?jq=.providerauth?

andig avatar Dec 03 '25 17:12 andig

Image

PTiTDaV avatar Dec 03 '25 17:12 PTiTDaV

Only one ?

andig avatar Dec 03 '25 17:12 andig

idem , but i managed to get it working by getting the usercode from the trace log an putting it into the bmw website in cardata - add device. But now i'm blocked because of too many requests

PTiTDaV avatar Dec 03 '25 17:12 PTiTDaV

Image

PTiTDaV avatar Dec 03 '25 17:12 PTiTDaV

Workaround for the moment : Go to mybmw webpage, select you car, select cardata. Scroll down until you get to the point where you see the clientid. There are 2 buttons : the second button is connect device. Go on until you have to fill in the code.

In EVCC push the authorisation link. Go to the logs and set the level to trace. Now search for user_code you should see a code appear. Fill it in in the BMW page (remove the ''' ) and login.

It should be connected afterwards

PTiTDaV avatar Dec 03 '25 19:12 PTiTDaV

Workaround for the moment : Go to mybmw webpage, select you car, select cardata. Scroll down until you get to the point where you see the clientid. There are 2 buttons : the second button is connect device. Go on until you have to fill in the code.

In EVCC push the authorisation link. Go to the logs and set the level to trace. Now search for userid or usercode you should see a code appear. Fill it in in the BMW page and login.

It should be connected afterwards

This indeed worked for me, thanks!

SDR3078 avatar Dec 03 '25 19:12 SDR3078

i don't see any specific information in the trace-log file when I press the button....

Krusty1977 avatar Dec 03 '25 19:12 Krusty1977

Workaround for the moment : Go to mybmw webpage, select you car, select cardata. Scroll down until you get to the point where you see the clientid. There are 2 buttons : the second button is connect device. Go on until you have to fill in the code. In EVCC push the authorisation link. Go to the logs and set the level to trace. Now search for userid or usercode you should see a code appear. Fill it in in the BMW page and login. It should be connected afterwards

This indeed worked for me, thanks!

Unfortunately cannot find anything searching for „userid“ or „usercode“ in the TRACE log. Could someone post a screenshot?

casiopopasio avatar Dec 03 '25 21:12 casiopopasio

It was my mistake. I didnt set log Level to trace. But then I found it and I fixed it via the workaround

Krusty1977 avatar Dec 03 '25 21:12 Krusty1977

Workaround for the moment : Go to mybmw webpage, select you car, select cardata. Scroll down until you get to the point where you see the clientid. There are 2 buttons : the second button is connect device. Go on until you have to fill in the code. In EVCC push the authorisation link. Go to the logs and set the level to trace. Now search for userid or usercode you should see a code appear. Fill it in in the BMW page and login. It should be connected afterwards

This indeed worked for me, thanks!

Unfortunately cannot find anything searching for „userid“ or „usercode“ in the TRACE log. Could someone post a screenshot?

Hello, I am as well not able to find it. I guess it should be here but no userid or code:

[oauth-6143b79e] TRACE 2025/12/03 23:50:44 POST https://customer.bmwgroup.com/gcdm/oauth/token
[oauth-6143b79e] TRACE 2025/12/03 23:50:44 client_id=cf675a5b-1ab8-4aa0-8dfe-655a27d3b908&code_verifier=_s_4olkzQiMgdVXbDeplftG9_lkeNZCjmht0kKoQIQ4&device_code=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJodHRwczovL2Zvcmdlcm9jay1ncmVlbi5wcm9kLWdjZG0uZXUtY2VudHJhbC0xLmF3cy5jbG91ZC5ibXc6NDQzL2FtL29hdXRoMiIsIm5iZiI6MTc2NDgwMjIyOSwidXNlcl9jb2RlIjoia2N4cXNFYzIiLCJpc3MiOiJodHRwczovL2Zvcmdlcm9jay1ncmVlbi5wcm9kLWdjZG0uZXUtY2VudHJhbC0xLmF3cy5jbG91ZC5ibXc6NDQzL2FtL29hdXRoMiIsImV4cCI6MTc2NDgwMjUyOSwiaWF0IjoxNzY0ODAyMjI5LCJqdGkiOiI2NWYyOTFlZC00ZmNiLTQwYTItYjlhMS05NjBmYWM4ZWI5MWUifQ.izV04kAOLmRdLTz_RqJqrkRRFgjBxGyY-k6qxDrVP0g&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code&scope=authenticate_user+openid+cardata%3Astreaming%3Aread+cardata%3Aapi%3Aread -- {"error_description":"The user has not yet completed authorization","error":"authorization_pending"}

Zeff1971 avatar Dec 03 '25 22:12 Zeff1971

@Zeff1971 there is a call previous to that one where the user_code is being sent.

PTiTDaV avatar Dec 04 '25 05:12 PTiTDaV

@Zeff1971 there is a call previous to that one where the user_code is being sent.

I Head the Same Problem

Workaround for the moment : Go to mybmw webpage, select you car, select cardata. Scroll down until you get to the point where you see the clientid. There are 2 buttons : the second button is connect device. Go on until you have to fill in the code. In EVCC push the authorisation link. Go to the logs and set the level to trace. Now search for userid or usercode you should see a code appear. Fill it in in the BMW page and login. It should be connected afterwards

This indeed worked for me, thanks!

Unfortunately cannot find anything searching for „userid“ or „usercode“ in the TRACE log. Could someone post a screenshot?

Hello, I am as well not able to find it. I guess it should be here but no userid or code:

[oauth-6143b79e] TRACE 2025/12/03 23:50:44 POST https://customer.bmwgroup.com/gcdm/oauth/token
[oauth-6143b79e] TRACE 2025/12/03 23:50:44 client_id=cf675a5b-1ab8-4aa0-8dfe-655a27d3b908&code_verifier=_s_4olkzQiMgdVXbDeplftG9_lkeNZCjmht0kKoQIQ4&device_code=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJodHRwczovL2Zvcmdlcm9jay1ncmVlbi5wcm9kLWdjZG0uZXUtY2VudHJhbC0xLmF3cy5jbG91ZC5ibXc6NDQzL2FtL29hdXRoMiIsIm5iZiI6MTc2NDgwMjIyOSwidXNlcl9jb2RlIjoia2N4cXNFYzIiLCJpc3MiOiJodHRwczovL2Zvcmdlcm9jay1ncmVlbi5wcm9kLWdjZG0uZXUtY2VudHJhbC0xLmF3cy5jbG91ZC5ibXc6NDQzL2FtL29hdXRoMiIsImV4cCI6MTc2NDgwMjUyOSwiaWF0IjoxNzY0ODAyMjI5LCJqdGkiOiI2NWYyOTFlZC00ZmNiLTQwYTItYjlhMS05NjBmYWM4ZWI5MWUifQ.izV04kAOLmRdLTz_RqJqrkRRFgjBxGyY-k6qxDrVP0g&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code&scope=authenticate_user+openid+cardata%3Astreaming%3Aread+cardata%3Aapi%3Aread -- {"error_description":"The user has not yet completed authorization","error":"authorization_pending"}

I had the same problem. However, whenever I called up the logs again, they were reset to debug and the field was not visible. I solved this by opening two browser windows. One with the logs and the Trace setting, and in the other I selected Auto in the menu at the top right and started the authentication. Then I clicked on Update in the log window.

sammy708 avatar Dec 04 '25 06:12 sammy708