Comments (8)
Solved in f0daaea
from fetch-tesla-token.
Thank you. Yeah, this kinda throws a wrench into the simple API I have today, as it will require a challenge-response kind of interaction.
I will find a fix for this as my users on smartcharge.dev needs it. But I might come up with a different solution. How are you using this API/project today?
from fetch-tesla-token.
+1 idem
:(
from fetch-tesla-token.
Just pushed a new updated version. Let me know if it works.
Unfortunately, this made the authentication flow a lot more complicated if you are using the API. It now goes something like this:
const { session, htmlForm } = await teslaAuth.newSession();
htmlForm.identity = input.email;
htmlForm.credential = input.password;
if (htmlForm.captcha !== undefined) {
if (input.captcha) {
htmlForm.captcha = input.captcha;
} else {
const captchaURI = await teslaAuth.getCaptcha(session);
// User intervention needed to solve the captcha
return captchaURI;
}
}
if (input.mfa) {
await teslaAuth.validateFactors(session, input.mfa, htmlForm.transaction_id);
}
const authCode = await teslaAuth.authenticate(session, htmlForm);
const bearerToken = await teslaAuth.bearerToken(authCode, session.codeVerifier);
const ownerToken = await teslaAuth.ownerapiToken(bearerToken.access_token);
from fetch-tesla-token.
It might be possible that you can always request a captcha to streamline the flow in two steps. But I have not tested it, as I went the totally different way for my service and only asking for captcha and mfa if it is required.
const { session, htmlForm } = await teslaAuth.newSession();
const captchaURI = await teslaAuth.getCaptcha(session);
// Show captcha and ask user for input
htmlForm.identity = input.email;
htmlForm.credential = input.password;
htmlForm.captcha = input.captcha;
...
from fetch-tesla-token.
Working for me, including captcha which is randomly back on today for me
from fetch-tesla-token.
It's ok for me , but error error 400 Bad request (with MFA) .
from fetch-tesla-token.
Working for me, including captcha which is randomly back on today for me
Mine also has MFA enabled, passed without issue
from fetch-tesla-token.
Related Issues (4)
- Refreshing HOT 3
- Error fetching Tesla sign in page ! HOT 4
- Does not work anymore ! HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fetch-tesla-token.