BMW-i-Remote icon indicating copy to clipboard operation
BMW-i-Remote copied to clipboard

anyone else getting HTTP 400/401 when retrieving token?

Open rs38 opened this issue 6 years ago • 13 comments

POSTing to https://b2vapi.bmwgroup.com/webapi/oauth/token/ with secret, key, user + password returns bad request, since ~10 days. I'm pretty sure, I did not change anything else.

rs38 avatar Sep 23 '18 11:09 rs38

some details from fiddler:

HTTP/1.1 400 Bad Request
Date: Sun****
Server: BMW Group API Gateway
X-NodeID: 03
X-Powered-By: JOY
Content-Type: application/json
Connection: close
Content-Length: 83
{
  "error" : "invalid_grant",
  "error_description" : "the authN circuit failed"
}

rs38 avatar Sep 23 '18 12:09 rs38

thanks to Google and this nice Github Project: https://github.com/m1n3rva/bimmer_connected the URL has changed at least for europe customers:

b2vapi.bmwgroup.com/gcdm/oauth/token/

rs38 avatar Sep 23 '18 12:09 rs38

for those of you who hardcoded the expiry time of the token to 8h: it's only 1h with the new gcdm OAuth

rs38 avatar Sep 25 '18 14:09 rs38

my CD implementation is done with .NET/c#. So I cannot test python… I test from europe. Changing paths was only needed for OAuth, not for further requests.

rs38 avatar Sep 28 '18 09:09 rs38

my CD implementation is done with .NET/c#. So I cannot test python… I test from europe. Changing paths was only needed for OAuth, not for further requests.

Would you be willing to share your ConnectedDrive .NET/c# code as I'm struggling to get anywhere. I'd really appreciate it.

HeraldCoupe avatar Sep 16 '19 15:09 HeraldCoupe

it's quick and dirty, but I would share at least the core of course. will let you know, when it's in a repo here. give me a few days, okay?

rs38 avatar Sep 17 '19 07:09 rs38

That would be amazing. Thanks so much.

HeraldCoupe avatar Sep 17 '19 07:09 HeraldCoupe

@HeraldCoupe I commited the core c# methods in my fork. of course I left out some key, secrets, specific stuff, which is also missing in the python code. you need to get it from a BMW CD app image e.g.

https://github.com/rs38/BMW-i-Remote

rs38 avatar Sep 19 '19 11:09 rs38

Thanks. I’ve not been able to get the key and secret stuff so far unfortunately. Without that I can’t go any further. 😢

HeraldCoupe avatar Sep 20 '19 07:09 HeraldCoupe

I think there are at least 2 ways to get the token from BMW. one is like the app (IOS+Android) with secret and key and the other is like a browser with the portal. Both can be found by sniffing your network traffic, googling or have a look in a Android .apk and search for it. This is quite easy.

rs38 avatar Sep 20 '19 08:09 rs38

@HeraldCoupe I just updated my .NET port and added a hint for the "secret" stuff (as it can be found in any CD repo) https://github.com/rs38/BMW-i-Remote/tree/master/csharp (latest commit)

rs38 avatar Jan 09 '20 06:01 rs38

@rs38 would you like to break out your .NET port into a separate (independent) repo, so that others can follow/star it and submit PRs?

vslee avatar Feb 19 '20 02:02 vslee

@vslee okay: https://github.com/rs38/CD-Sharp unlike the pute code in my fork it's now more complete but does not compile as .NET Core migration in progress.

rs38 avatar Feb 19 '20 17:02 rs38