Skip to content
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

Fixed issue getting tesla token on username and password login #100

Merged
merged 1 commit into from
May 21, 2023

Conversation

evenmun
Copy link

@evenmun evenmun commented May 18, 2023

Issue: #83

@bogosj bogosj requested a review from andig May 19, 2023 01:30
@bogosj
Copy link
Owner

bogosj commented May 19, 2023

I haven't used cmd/login in quite a while. When I run it with this PR I get the following:

go run . -o ~/tesla.token
Username: b****@gmail.com
Password: *********
✔ Passcode: 298871|

2023/05/19 01:30:36 verify: json decode: invalid character 'F' looking for beginning of value
exit status 1

@evenmun
Copy link
Author

evenmun commented May 19, 2023

That's strange. I will look into that, but can you provide me with some more information?

  • Can you see what you get from the last request in the authentication process?
  • Where in the project dose it breake ?

@bogosj
Copy link
Owner

bogosj commented May 19, 2023

I'm getting the following string:

"Found. Redirecting to /oauth2/v3/authorize/mfa/verify"

From this request:
https://github.com/bogosj/tesla/blob/main/auth.go#L233

Edit: When it attempts to decode the JSON here:
https://github.com/bogosj/tesla/blob/main/auth.go#L244
`

@evenmun evenmun force-pushed the fix-login-with-username-and-password branch from d9fd2f8 to ba5e1b4 Compare May 21, 2023 08:42
@evenmun
Copy link
Author

evenmun commented May 21, 2023

Hey :)
Are you able to test the changes again?
The problem was the MFA verification request needed the _csrf token, and also, there was some issue decoding the MFA Verify response.

@bogosj
Copy link
Owner

bogosj commented May 21, 2023

Working now with MFA. Thanks for the contribution.

@bogosj bogosj merged commit 7ff2b57 into bogosj:main May 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants