-
-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accomodate for Stellantis' Jan 23 OAuth changes #754
Conversation
…p involved during setup but at least the error 500 is gone)
Fixes #733 |
…p involved during setup but at least the error 500 is gone)
psa_car_controller/psa/constants.py
Outdated
@@ -28,7 +28,7 @@ | |||
"program3": {"day": [0, 0, 0, 0, 0, 0, 0], "hour": 34, "minute": 7, "on": 0}, | |||
"program4": {"day": [0, 0, 0, 0, 0, 0, 0], "hour": 34, "minute": 7, "on": 0} | |||
} | |||
AUTHORIZE_SERVICE = "https://api.mpsa.com/api/connectedcar/v2/oauth/authorize" | |||
AUTHORIZE_SERVICE = "https://idpcvs.opel.com/am/oauth2/authorize" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this change been tested for other brands?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For lack of test accounts: no. Stellantis seems to be doing all kinds of crazy OAuth proxying internally so maybe if we're lucky the endpoints can just be used interchangeably. I found the original URL from the Android app's logcat output, the others I just found them in classes4.dex so I just made AUTHORIZE_SERVICE a dict too.
classes4.dex.txt:43f3a0: 1a02 bd90 |0012: const-string v2, "https://idpcvs.driveds.com/am/oauth2/authorize" // string@90bd
classes4.dex.txt:43f3ec: 1a02 c390 |0038: const-string v2, "https://idpcvs.peugeot.com/am/oauth2/authorize" // string@90c3
classes4.dex.txt:43f438: 1a02 ba90 |005e: const-string v2, "https://idpcvs.citroen.com/am/oauth2/authorize" // string@90ba
classes4.dex.txt:43f488: 1a02 c090 |0086: const-string v2, "https://idpcvs.opel.com/am/oauth2/authorize" // string@90c0
classes4.dex.txt:43f4da: 1a02 c690 |00af: const-string v2, "https://idpcvs.vauxhall.co.uk/am/oauth2/authorize" // string@90c6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you are right.
Now I get peugeot link, but it still shows this error while trying to access
{ "error": "redirect_uri_mismatch", "error_description": "The redirection URI provided does not match a pre-registered value." }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oha. The "op" in "mymop" stands for Opel then I guess 😅 🤦
So let's pass the brand_code into the URL too...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oha. The "op" in "mymop" stands for Opel then I guess 😅 🤦 So let's pass the brand_code into the URL too...
This worked for me, Thanks :-)
However, I have no idea how to incorporate this in to HA
Got this error 3 hours after first setup. OTP Pin is received. But when entered got this message. 2024-02-07 22:01:57,870 :: ERROR :: Error during activation: {'newversion': None, 'newversionurl': None, 'err': 'NOK:ACCESS'} |
RateLimitException seems pretty self-explanatory. Looks like you retried the SMS-step too many times in a too short period of time. Pretty sure each SMS costs Stellantis a cent or two so it makes sense that the rate limits are very thight there. This "remote_refresh_token": null seems kind of odd too. Did you remove both token lines from the config.json? You should've set them to an empty string, like remote_refresh_token: "" |
I get pretty much the same errors in HA, while trying for remote functions. |
Thanks for your work on this :) I updated all the codes from here (I believe), but when booting I get:
my config.json:
|
Did you delete the otp.bin and launch with --web-conf? |
Ah that would be the step I missed. However, I go to the login URL provided in the console. Log in, and then when logging in Dev Tools in FF (also tried Chrome), I'm struggling to see where the |
Ah sweet - managed to get that going now :) The main stuff seems to work, but pre-conditioning gives this error:
|
no, i just removed the values. |
It looks like there is a problem it the remote_refresh_token 2024-02-11 19:19:39,328 :: ERROR :: can't refresh_remote_token: {'error_description': "Missing parameter, 'refresh_token'", 'error': 'invalid_request', 'refresh_token': ''} But refresh_token is not empty in my config file. OTP is not working and Opel Login page is french, even if german or DE ist set in language setting. |
'http://m.inwebo.com/', 'err': 'NOK:FORBIDDEN'} Install on a smartphone mypeugeot, myopel etc, depending on your car brand |
@vineethktpla Thanks Uninstall and Reinstall the app on mobile and setting new pin solved the problem. |
This fixes psacc crashing with: TypeError: Client.__init__() missing 1 required positional argument: 'callback_api_version' paho-mqtt 2.0, released on Feb, 10th, requires additional arguments to mqtt.Client(), see https://github.com/eclipse/paho.mqtt.python/blob/v2.0.0/docs/migrations.rst. So stay with 1.x for now.
fix: stay with paho-mqtt 1.x due to breaking change in 2.0
Thanks for your help. I will do some reworks and then merge it on master. |
@flobz, great to see you've picked that up!! For the time being, until this is merged into
|
Hi "mymop" seems to work for Opel, I have a car from peugeot and get the redirect_uri as "mymap://oauth2redirect/fr" so "ap" instead of "op" in case of Opel and it doesn't seem to work. |
The error was raised in Firefox, with Chrome it works! |
Still one manual step involved during setup but at least the error 500 is gone.