Skip to content
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

Users randomly receiving "User revoked consent" 401 errors #139

Closed
stx opened this issue Jan 11, 2024 · 29 comments
Closed

Users randomly receiving "User revoked consent" 401 errors #139

stx opened this issue Jan 11, 2024 · 29 comments
Labels
Fleetnet Issue with Tesla's backend system

Comments

@stx
Copy link

stx commented Jan 11, 2024

Some users are (randomly?) receiving "User revoked consent" 401 errors whenever their access token is refreshed. This is happening multiple times a day, and it forces them to reauthorize their account over and over again - but the reauthorizations are automatic and do not prompt them for consent, so consent has not actually been revoked.

They claim they are not altering their Tesla account in any way and have no other apps or services running.

Here is an example Tesla OAuth response:

HTTP 401
{"error":"login_required","error_description":"User revoked consent","error_uri":"https://auth.tesla.com/error/reference/c9e8ec46-74d8-4eb1-9ff1-caab349db462-1705012163951"}
@sethterashima sethterashima added the Fleetnet Issue with Tesla's backend system label Jan 12, 2024
@stx
Copy link
Author

stx commented Jan 15, 2024

Found this happening with some more Tesla customers.

Appears like it might be isolated to Europe.

Adding MFA, changing passwords, resetting apps/services doesn't help. "User revoked consent" is happening for them every 8 hours as the token refreshes.

@sapkra
Copy link

sapkra commented Jan 17, 2024

I think the problem happens if a user who is signing in is registered in another region than the partner account. My partner account is in the EU but NA users are getting exactly this error.

After changing the region from one account from NA to EU everything works fine for this account.

@stx
Copy link
Author

stx commented Jan 19, 2024

I think the problem happens if a user who is signing in is registered in another region than the partner account. My partner account is in the EU but NA users are getting exactly this error.

After changing the region from one account from NA to EU everything works fine for this account.

@sapkra It sounds like you found a solution to this, but I don't follow. What do you mean you changed the region?

@sapkra
Copy link

sapkra commented Jan 20, 2024

You can move a user to EU servers (the region of the account) in the account settings on the Tesla Website. As a developer you should know how because it's disabled for some reason to "normal" users.

@stx
Copy link
Author

stx commented Jan 20, 2024

You can move a user to EU servers (the region of the account) in the account settings on the Tesla Website. As a developer you should know how because it's disabled for some reason to "normal" users.

@sapkra Weird, I can't find this setting anywhere on either user or developer accounts. Can you post a URL and screenshot of this setting?

@sapkra
Copy link

sapkra commented Jan 21, 2024

https://accounts.tesla.com/account-settings/personal-information/edit-basic-information

PS: in my case I needed the developer console to change the region ;)

@sapkra
Copy link

sapkra commented Jan 24, 2024

Here the full explanation how to change the region:

  1. Go to the page Account Settings and click on "Edit Basic Information"
  2. Make "Inspect element" on the region select input.
  3. Remove disabled and add a new option with the value of your region e.g. DE for Germany.
  4. You can now select the new region and language in the user interface and save the changes.

@jaggerc
Copy link

jaggerc commented Jan 27, 2024

I am getting the same when refreshing a token. Data calls work fine until the token expires.

HTTP 401
{"error":"login_required","error_description":"User revoked consent"

It's only for eu users. We are registered in the US.

We have tried every combination of things to change when registering an eu user but still get stuck on the refresh not working. Unfortunately we cannot ask every user to go in and change their region in developer mode.

Did anyone figure this issue out?

@stx
Copy link
Author

stx commented Jan 28, 2024

I'm receiving hundreds of emails about this and really am not sure what to tell people. I have tried pretty much everything imaginable.

@jpgough
Copy link

jpgough commented Jan 28, 2024

+1 I’m one of those people emailing @stx as a user. This needs to be fixed, as it’s clearly not implementing the OAuth2 standard correctly from a user perspective.

My region is set to UK. Any further details that help I’m happy to help supply.

@itsMeDavidV
Copy link

Can confirm we are seeing many cases of this. This should be treated as critical @sethterashima

@dmitrybirin
Copy link

Hello! 👋 We are using fleet api and now start experience the same problem.
We're based in EU. Around half of our users in EU experience problems, so we're not see correlation with the region. Like @stx said in original post it seems to be random.

Would appreciate any feedback from Tesla, but support haven't responding to our emails.

@sp00nsthlm
Copy link

Hey!

I have this problem with one of my two 3rd party apps, the Smart charging at home connected to my electricity company "Tibber" works perfectly but the Tessie app (for driving record) logs out after exactly 8 hours. Very surprising as I need it for accounting of the car's private versus service miles. Do we know if anyone is working on a solution?

@kevin39
Copy link

kevin39 commented Jan 31, 2024

Same here. Tessie logout every 8h. very annoying :(
Didn't found any working workaround.

@bassmaster187
Copy link

It happen to me as well. My wifes car was for any reason in region "US". After moving it to "EU" / German account as described by
@sapkra it works now. Please Tesla fix the bug!

@sp00nsthlm
Copy link

It happen to me as well. My wifes car was for any reason in region "US". After moving it to "EU" / German account as described by @sapkra it works now. Please Tesla fix the bug!

My account is locked to my country sweden and i can't choose any other? i did however put in my home adress, se if that will change the fault...

@fabianhu
Copy link
Contributor

Did you define the scope "offline_access" at registration and did the token refresh work?
offline_access enables token refresh without another login by the customer.
Token expiry time is 8h.

I don't know much about the Go technique refreshing tokens, but my python implementation kind of works.
Hope this helps.

@jpgough
Copy link

jpgough commented Feb 1, 2024

@stx I'm not sure if this helps, or is just random. As has been usual over the past few days Tessie kicked me out yesterday and asked for an access token. However this time I happened to be in a private browser on Safari on iOS. I had to log back in with username, password, authenticator code.

Since I've done this I've not been kicked out again (I was expecting that to have happened this morning and yesterday afternoon).

@stx
Copy link
Author

stx commented Feb 1, 2024

It appears that Tesla has rolled out an auth system update with a new refresh token format, and this problem seems to be fixed now judging from the experience of several users. Can anyone else confirm this issue has been resolved for them as well before I close this?

@itsMeDavidV
Copy link

itsMeDavidV commented Feb 1, 2024

@stx No, I'm still seeing frequent cases of login_required. I'd hold off on closing this.

@KonradGridio
Copy link

We see that Tesla updated refresh_token structure yesterday. Which means all fleet_api token refreshes failed (401 login required - our entire fleet on those), but then after customers log in again, then everything works and the original 401 Error Revoked problem disappears.

So a heavy-handed fix it seems, but did the trick. Now just have to get all our drivers to re-connect :(.

@sp00nsthlm
Copy link

Hi, mine seems to have been working since yesterday, had an update to the Tesla app from the App-store in my phone, but so far it's been working and I'm hopeful now. But eagerly waiting for it to crash again…

@jaggerc
Copy link

jaggerc commented Feb 1, 2024

Just out of curiosity, where are you seeing that Tesla updated the token refresh system? Are they publishing a log somewhere?

@Chrophe
Copy link

Chrophe commented Feb 1, 2024

Hi, I don't have to log in to Tesla since yesterday as well. I switched my connectivity in Tessie account yesterday and I had to log in again with my ID and 2FA. No problem anymore.

@kevin39
Copy link

kevin39 commented Feb 1, 2024

No logout anymore on my side since +30h ago. That never happened.
Maybe the issue is solved ?

@sp00nsthlm
Copy link

I still see problems with registration of runs, last run was registered int but the app is stuck in idle... despite several restarts

@sp00nsthlm
Copy link

How difficult would it be for tesla to create a driving journal themselves to keep track of their private vs business miles, with the option to save as an excel file? then we wouldn't have this problem...

@ThomasAlxDmy
Copy link
Contributor

Hey all we've now upgraded the system, this bug should be resolved. Thank you for the feedback to chase this down!

@stx
Copy link
Author

stx commented Feb 1, 2024

@ThomasAlxDmy

Thanks for confirming. I believe those still having issues are running into the new change that refresh tokens can no longer be used twice: #160.

@stx stx closed this as completed Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fleetnet Issue with Tesla's backend system
Projects
None yet
Development

No branches or pull requests