BMW-i-Remote
BMW-i-Remote copied to clipboard
anyone else getting HTTP 400/401 when retrieving token?
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.
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"
}
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/
for those of you who hardcoded the expiry time of the token to 8h: it's only 1h with the new gcdm OAuth
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.
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.
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?
That would be amazing. Thanks so much.
@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
Thanks. I’ve not been able to get the key and secret stuff so far unfortunately. Without that I can’t go any further. 😢
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.
@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 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 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.