-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refreshing #1
Comments
There's no built-in function for refreshing a token in the HTML page. But if you run it locally with node.js it's super easy making your own, just using the cleaned-up teslaAuth.js library I added in the latest commit. Clone or download the repository. Then create a const teslaAuth = require("./teslaAuth");
const token = teslaAuth
.refreshToken("<<<YOUR REFRESH TOKEN>>>")
.then(t => console.log(t)) Run it with The refresh call is a simple POST to the Tesla server. You can just curl it if you like. curl --header "Content-Type: application/json" --data '{
"grant_type":"refresh_token",
"scope":"openid email offline_access",
"client_id":"ownerapi",
"refresh_token":"<<<YOUR REFRESH TOKEN>>>"
}' https://auth.tesla.com/oauth2/v3/token |
The fetch-tesla-token/teslaAuth.js Lines 102 to 112 in 5c31098
fetch-tesla-token/teslaAuth.js Lines 273 to 279 in 5c31098
fetch-tesla-token/teslaAuth.js Lines 294 to 300 in 5c31098
|
That's great, thanks for taking the time to reply, I'll try it out in the morning (01:11 here) |
Hi,
I have a valid refresh token, how would I subsequently execute your code using the refresh_token rather than starting from email/password?
Thanks
The text was updated successfully, but these errors were encountered: