Last active
August 8, 2019 17:14
-
-
Save felickz/cd3fd2bb5f8a3e61ca53ab79fa366615 to your computer and use it in GitHub Desktop.
PowerShell script to get an AT / RT from the Tesla authorization server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FYI that client id and secret are very public information