Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.
/ tesla-oauth2 Public archive

General description about how Tesla does 2FA and how to detect if a user has 2FA enabled

Notifications You must be signed in to change notification settings

enode/tesla-oauth2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tesla OAuth Token Generation

A "proof-of-concept" script on how to interact with the recent OAuth2 changes from Tesla and the new /oauth2/ endpoint. It was open sources so we could let other people in the community better understand the flow of how secrets were passed around in a token exchange.

How to run

  • Make sure you have Python 3 installed
  • Make sure you have chromedrier installed
  • pip install -r requirements.txt
  • Run the script while passing in email and password along with a token file (not required)
  • If account has MFA enabled you need to pass --passcode UNUSED_PASSCODE (passcode generated by your authenticator app) or --backup_passcode PASSCODE (one of your unused backup passcodes)
  • Tesla supports up to 2 authenticator devices. By default script uses 1st device. You can pass --device 2 to use 2nd device.
bc@anton-mbp ~/H/p/e/tesla-oauth2> python tesla.py -h
usage: tesla.py [-h] -e EMAIL -p PASSWORD [-f FILE] [--verbose]
                [--device {1,2}]
                [--passcode PASSCODE | --backup_passcode BACKUP_PASSCODE]

optional arguments:
  -h, --help            show this help message and exit
  -e EMAIL, --email EMAIL
                        Tesla account email
  -p PASSWORD, --password PASSWORD
                        Tesla account password
  -f FILE, --file FILE  Filename to save tokens
  --verbose             Be verbose
  --device {1,2}        2FA device to use
  --passcode PASSCODE   Passcode generated by your authenticator app
  --backup_passcode BACKUP_PASSCODE
                        Unused backup passcode

Troubleshooting

If you are looking for documentation we suggest you check out https://github.com/timdorr/tesla-api

About

General description about how Tesla does 2FA and how to detect if a user has 2FA enabled

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published