Duke-U
Member
I wonder, has nobody compiled this into a simple webpage or program to make this accessible for simple non-nerds? I think you solve a great security issue here...
You can install our site as a web app on your iOS device by utilizing the Add to Home Screen feature in Safari. Please see this thread for more details on this.
Note: This feature may not be available in some browsers.
Thank you for thisI added in a flag to the command line tool in teslams to print a token.
Code:teslacmd -u [email protected] -p pa55w0rd --print_token
As in, I downloaded Python and installed it (from Download Python ). Then I open IDLE. Then, what command do I run to execute teslatoken.py and pass in a username and password?Any more on how to execute the Python script that was posted for anyone new to Python?
How do you use this app to create the token? On a Mac and trying to figure this out. Thanks.As another alternative for getting a token one can use Postman.
On the Mac you can use Platypus or Automator to wrap a shell script into an app. I use PlatypusHow do you use this app to create the token? On a Mac and trying to figure this out. Thanks.
Here you go, just replace <USERNAME> with your username for Tesla owner login and same for <PASSWORD>
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -F "grant_type=password" -F "client_id=81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384" -F "client_secret=c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3" -F "email=<USERNAME>" -F "password=<PASSWORD>" "https://owner-api.teslamotors.com/oauth/token"
@BigD0g thanks for the code. However when I try to execute in mac Terminal with a bogus username and password to test, I get:
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -F "grant_type=password" -F "client_id=81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384" -F "client_secret=c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3" -F "[email protected]” -F "password=1234password” "https://owner-api.teslamotors.com/oauth/token"
{"response":"{\"message\"=>\"object_reference_not_set_to_an_instance_of_an_object.\",_\"stacktrace\"=>\"___at_myteslawebservice.controllers.authenticationcontroller.<authenticate>d__1.movenext"}
Any other tips you can give to someone new to this?
It will only work with a valid username / password on a valid tesla owner account.
Ok it just seems weird bc the error says " object_reference_not_set_to_an_instance_of_an_object " not "invalid username/password
Can anyone that is familiar with Python 3.6 provide some instruction how to run the Teslatoken.py script that was posted in this thread? Perhaps the OP can jump in? I realize that there are other web based tools to do this instead of software like Python but using those third party websites brings up other security concerns.
python teslatoken.py -e <mytesla email> -p <mytesla password>
Thank you this one worked perfectly for meYou can run a simple curl command in the Terminal as follows. Just update the email and password value.
Code:curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -F "grant_type=password" -F "client_id=81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384" -F "client_secret=c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3" -F "email=USER_YOUR_EMAIL" -F "password=USER_YOUR_PASSWORD" "https://owner-api.teslamotors.com/oauth/token"
Thanks! This was the easiest method to meYou can run a simple curl command in the Terminal as follows. Just update the email and password value.
Code:curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -F "grant_type=password" -F "client_id=81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384" -F "client_secret=c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3" -F "email=USER_YOUR_EMAIL" -F "password=USER_YOUR_PASSWORD" "https://owner-api.teslamotors.com/oauth/token"