Skip to content

Instantly share code, notes, and snippets.

@felickz
Last active August 8, 2019 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felickz/cd3fd2bb5f8a3e61ca53ab79fa366615 to your computer and use it in GitHub Desktop.
Save felickz/cd3fd2bb5f8a3e61ca53ab79fa366615 to your computer and use it in GitHub Desktop.
PowerShell script to get an AT / RT from the Tesla authorization server
$uri = 'https://owner-api.teslamotors.com/oauth/token'
$email = "a@b.com"
$pw = "pw123!"
$json = @{
grant_type = "password"
client_id = "81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384"
client_secret = "c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3"
email = "$email"
password = "$pw"
} |ConvertTo-Json
#Write-Output $json
Invoke-WebRequest -Uri $uri -ContentType "application/json" -Method POST -Body $json | Select-Object -ExpandProperty Content
@felickz
Copy link
Author

felickz commented Aug 8, 2019

FYI that client id and secret are very public information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment