timdorr / tesla-api

🚘 A Ruby gem and unofficial documentation of Tesla's JSON API for the Model S, 3, X, and Y.

Home Page:https://tesla-api.timdorr.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

403 during token refresh only on docker

barancezayirli opened this issue · comments

Hi,

I have been following the guide for authentication.

  • I manage to authenticate the user, get the access token and refresh the token. I do this by, letting users log in with the tesla auth URL themselves in the app, and get the tokens. This works even in deployed version as I am not calling the tesla auth from the server but from the client.
  • I am refreshing the auth token before they expire in the server. This works in localhost.
  • The problem comes when I deploy the server. Whenever I want to refresh the token, it fails with 403 error.

I use node js as server, dockerized, and deployed to a Kubernetes cluster.

Following the discussions here
I do think I have all the headers that I need, and I am making sure TLS is max 1.2
{ headers: { 'Content-Type': 'application/json', Accept: 'application/json', 'User-Agent': 'TeslaAuthJS/1.0', 'Keep-Alive': 'timeout=60000', }, agent: new https.Agent({ maxVersion: 'TLSv1.2', keepAlive: true, }), };

Anyone can give me some ideas?