Brandawg93 / homebridge-fordpass

Control your Ford vehicle in HomeKit using Homebridge.
GNU General Public License v3.0
61 stars 15 forks source link

[Bug]: Unable to authorize #188

Closed JeffGoldner closed 2 years ago

JeffGoldner commented 2 years ago

Describe the bug

I haven't used the plugin for a long time and had it disabled. Today I updated to the latest build and re-enabled, but it throws an error on Authentication when the plug-in (and homebridge) starts. I checked the login credentials, set the region to US, made sure I could log in to the owner.ford.com website with the same creds, and verified that I was still logged in via the FordPass app. My car shows up in both places.

Not sure what to do here. Might try deleting the plugin and reinstalling.

Debug Output

6/23/2022, 9:05:43 AM] [FordPass] Auth failed with error: ERR_BAD_REQUEST

Steps to reproduce

  1. Enable FordPass
  2. Verify settings
  3. Restart Homebridge

Device Type

Official Ubuntu VM/Docker on HyperV (Win10)

iOS Version

15.5

Bug Persistence

Consistently

Last Working Version

No response

Brandawg93 commented 2 years ago

Try clearing your accessory cache in Homebridge. The authentication method has recently changed.

JeffGoldner commented 2 years ago

Try clearing your accessory cache in Homebridge. The authentication method has recently changed.

I did nothing but it started working the next day all on its own.

BatMahn commented 2 years ago

I'm just now getting the same error. No recent changes, things have been working steady-eddy for months.

Tried clearing accessories, no dice.

Password hasn't changed, I can login via the App with no issues.

Any other suggestions?

Brandawg93 commented 2 years ago

Make sure the plugin is up-to-date. Ford recently changed some things in their api.

BatMahn commented 2 years ago

First thing I tried, also tried rolling back to 1.6x, that gives a 400 error vs the ERR_BAD_REQUEST on 1.7x

BatMahn commented 2 years ago

(I am outside of the US too - Canada), I set the region on the advanced settings via Homebridge UI, but after restarting Homebridge, it seems to be stuck on US.. should I change it in the config file manually maybe?

Edit: what's the proper string for Canada? It seems to stay as "71A3AD0A-CF46-4CCF-B473-FC7FE5BC4592" no matter if I toggle between US or Canada.

BatMahn commented 2 years ago

Maybe something related to what's described here? (ford messing around again)

https://github.com/itchannel/fordpass-ha/issues/187

Brandawg93 commented 2 years ago

Ford broke their API again...Looks like you can no longer authorize with a username and password.

ianjwhite99 commented 2 years ago

Ford broke their API again...Looks like you can no longer authorize with a username and password.

Just came here to say that. Looks like they've finally removed the password grant type and moved to authorization codes

Brandawg93 commented 2 years ago

This should be fixed in v1.7.1. Feel free to reopen if you still have issues.

BatMahn commented 2 years ago

Hi, just updated, get this error and it crashes home bridge entirely:

UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "AxiosError: Request failed with status code 401".

Brandawg93 commented 2 years ago

Did you try clearing the cache?

BatMahn commented 2 years ago

No, one moment.

Edit: appears to get the same error message: UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "AxiosError: Request failed with status code 401".

What's the expected behaviour with the new setup? (this is on a headless pi).. so it won't be able to launch a browser window as an example..

Brandawg93 commented 2 years ago

You shouldn't need to launch a browser. I'll have to play around with it since mine is working and I can't reproduce this.

BatMahn commented 2 years ago

"to be fair".. could just be me.. guess lets see if anyone else has the same problem...

Brandawg93 commented 2 years ago

Try v1.7.2-test.0 and see if that gives you any extra info.

BatMahn commented 2 years ago

See attached, error.txt

Brandawg93 commented 2 years ago

Ah. It seems to not like your region. Which region have you chosen?

BatMahn commented 2 years ago

Ah, that might have been it. I was dinking around with the region earlier.

Setting back to US seems to get rid of the error.

Brandawg93 commented 2 years ago

Great! There still may be an issue for people in another region, but I'll still close this for now.