adriankumpf/tesla_auth
adriankumpf/tesla_auth has 664 GitHub stars and 52 forks. GitHot measured +1 stars in 24 hours. Last checked 2026-11-15 23:27 UTC. Last push 2026-09-14.
Measured star growth
- in 24h
- +1
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
Securely generate API tokens for third-party access to your Tesla.
Developer ToolsREADME.md
OriginalTesla Auth
Securely generate API tokens for third-party access to your Tesla.
Supports MFA and Captcha through Tesla's native login flow.
Download
- macOS Apple Silicon / Intel
- Linux x86_64 / ARM
- Windows
Usage
❯ tesla_auth --help
Usage: tesla_auth [-d] [-c] [-v]
Tesla API tokens generator
Options:
-d, --debug print debug output
-c, --clear-browsing-data
clear browsing data at startup
-v, --version print the version and exit
--help, help display usage information
Steps
- Run the
tesla_authexecutable (either by double-clicking it or directly in a terminal) - Enter your Tesla account credentials (and MFA code if necessary)
- You'll get a final window where you can select and copy the access token and refresh token
Platform-specific dependencies
macOS
WebKit is native on macOS so no additional dependencies are required.
Windows
WebView2 provided by Microsoft Edge Chromium is used. So Windows 7, 8, 10 and 11 are supported.
Linux
WebKitGTK 4.1 is required for WebView and libxdo is used to make the predfined Copy, Cut, Paste and SelectAll menu items work. Ubuntu 22.04, Debian 12 and Fedora 36 are the earliest releases that ship WebKitGTK 4.1; on anything older neither the prebuilt binaries nor a local build will run.
So please make sure the following packages are installed:
Arch Linux / Manjaro:
sudo pacman -S webkit2gtk-4.1 xdotool
Debian / Ubuntu:
sudo apt install libwebkit2gtk-4.1-dev libxdo-dev
Fedora
sudo dnf install gtk3-devel webkit2gtk4.1-devel xdotool
Troubleshooting
Run tesla_auth --debug first: it prints the URLs the webview navigates to, which is usually enough to tell where a flow gets stuck.
Blank window, or a window that disappears immediately (Linux)
WebKitGTK's accelerated rendering paths misbehave on a number of drivers, the NVIDIA proprietary one in particular. Typical symptoms are Failed to create GBM buffer of size … or Error 71 (Protocol error) dispatching to Wayland display.
tesla_auth therefore disables the DMA-BUF renderer by default. If the window still does not come up, try:
WEBKIT_DISABLE_COMPOSITING_MODE=1 tesla_auth # turn off compositing entirely
GDK_BACKEND=x11 tesla_auth # run under XWayland
WEBKIT_DISABLE_DMABUF_RENDERER=0 tesla_auth # opt back into the default renderer
The login form keeps returning to the sign-in page
Stale cookies from a previous session are the usual cause. Start over with a clean profile:
tesla_auth --clear-browsing-data
Access Denied — You don't have permission to access … on this server
The request was rejected by Tesla's CDN before it ever reached the login page (the reference URL points at errors.edgesuite.net, i.e. Akamai). This is an IP reputation block rather than something tesla_auth can influence — disconnect from a VPN, or force a new public IP by power-cycling your router, and try again.
TeslaMate reports Error: Tokens are invalid
The tokens are pasted into TeslaMate, which then talks to auth.tesla.com itself. If that request fails, TeslaMate reports the tokens as invalid even though they are fine — check its logs for the actual error, and retry once Tesla's SSO endpoints are healthy again.
macOS logs _TIPropertyValueIsValid called with 11 on nil context!
Noise from the system input manager that any WebKit-based app produces. It has no effect on the login flow.
Development
# Clone repository
git clone https://github.com/adriankumpf/tesla_auth
cd tesla_auth
# Build (debug version)
cargo build
# Install (release version)
cargo install --path . --locked
License
MIT