Skip to content

[Step 2] Receiving a 403 no matter what I try (SOLVED) #501

Answered by SystemDisc
SystemDisc asked this question in Q&A
Discussion options

You must be logged in to vote

The solution I came up with was to do all of the login logic in the browser using puppeteer:

import util from 'util';
util.inspect.defaultOptions.depth = null;
import crypto from 'crypto';
import puppeteer from 'puppeteer';
import axios from 'axios';

const TESLA_CLIENT_ID = '81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384';
const TESLA_CLIENT_SECRET = 'c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3';

async function teslaLogin(email: string, password: string): Promise<{ access_token: string, refresh_token: string }> {
  // this seems to be how Tesla serializes params
  const paramsSerializer = (params: {[key: string]: string}) => {
    return Object.keys(

Replies: 4 comments 11 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
9 replies
@duizendnegen
Comment options

@haha150
Comment options

@ghost
Comment options

@ghost
Comment options

@Rockster160
Comment options

Answer selected by SystemDisc
Comment options

You must be logged in to vote
1 reply
@SystemDisc
Comment options

Comment options

You must be logged in to vote
1 reply
@duizendnegen
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants