Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

anyone else getting HTTP 400/401 when retrieving token? #45

Open
rs38 opened this issue Sep 23, 2018 · 13 comments
Open

anyone else getting HTTP 400/401 when retrieving token? #45

rs38 opened this issue Sep 23, 2018 · 13 comments

Comments

@rs38
Copy link
Contributor

rs38 commented Sep 23, 2018

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
Copy link
Contributor Author

rs38 commented Sep 23, 2018

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
Copy link
Contributor Author

rs38 commented Sep 23, 2018

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 rs38 closed this as completed Sep 23, 2018
@rs38
Copy link
Contributor Author

rs38 commented Sep 25, 2018

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

@rs38 rs38 reopened this Sep 25, 2018
@rs38 rs38 changed the title anyone else getting HTTP 400 when retrieving token? anyone else getting HTTP 400/401 when retrieving token? Sep 25, 2018
@rs38
Copy link
Contributor Author

rs38 commented Sep 28, 2018

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.

@HeraldCoupe
Copy link

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.

@rs38
Copy link
Contributor Author

rs38 commented Sep 17, 2019

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?

@HeraldCoupe
Copy link

That would be amazing. Thanks so much.

@rs38
Copy link
Contributor Author

rs38 commented Sep 19, 2019

@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

@HeraldCoupe
Copy link

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

@rs38
Copy link
Contributor Author

rs38 commented Sep 20, 2019

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
Copy link
Contributor Author

rs38 commented Jan 9, 2020

@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)

@vslee
Copy link

vslee commented Feb 19, 2020

@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?

@rs38
Copy link
Contributor Author

rs38 commented Feb 19, 2020

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants