Giter Site home page Giter Site logo

tesla-oauth2's Introduction

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

tesla-oauth2's People

Contributors

apodobytko avatar benderl avatar heumn avatar jeffkowalski avatar mikebishop avatar oldmanlink avatar swm11 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.