Replies: 5 comments 13 replies
-
Where are you generating the |
Beta Was this translation helpful? Give feedback.
-
The c# WebClient receives a redirect and automatically redirects the WebClient. You have to turn off this behaivor:
you can find a working c# login in Teslalogger. Take a look at Method GetToken() https://github.com/bassmaster187/TeslaLogger/blob/master/TeslaLogger/WebHelper.cs |
Beta Was this translation helpful? Give feedback.
-
Hi,
I was stuck last sunday on this too...
Don't forget to url encode your POST payload
in php:
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields));
where fields contains the hidden fields from step 1 ("_csrf", "_phase",
"_process", "transaction_id", and "cancel") plus "identity" and "credential"
Now it works well on my tool (jeedom tesla plugin)
Nicolas
…On Thu, Feb 4, 2021 at 2:23 AM AmosFitness ***@***.***> wrote:
Thanks! Doing the autoredirect change did stop me from re-directing! Thats
great. But I am not really seeing the "code" in the location adress.
Location =
/oauth2/v3/authorize?client_id=ownerapi&code_challenge=AqmK9kpHyf+DmT1FztBZAzsUy468Dq36jIusyzrp1t8=&code_challenge_method=S256&redirect_uri=
https://auth.tesla.com/void/callback&response_type=code&scope=openid%20email%20offline_access&state=123
Hi, I had the same Location back without "code" in it, would you like to
tell me what did I miss?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#269 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKZEEOKC7FNDC5AU6FAPLR3S5HZKRANCNFSM4W3VGUDQ>
.
|
Beta Was this translation helpful? Give feedback.
-
@salvesen Are you building a reusable C# library for the new Tesla auth system? I need this too, and will gladly help. It sounds like you've already made progress so it would be a shame for me to start from scratch. |
Beta Was this translation helpful? Give feedback.
-
OK, here's my first attempt at a reusable C# library. Thanks to @bassmaster187 for letting me lift so much of his code. It was very hastily put together so most likely has some issues, but let me know if it's of any use. |
Beta Was this translation helpful? Give feedback.
-
Getting quite frustrated testing this new oAuth thing.
I got the first step, I now have the "hidden" inputs and cookie.
But when trying to post(step 2) I only get the same HTML code as in step 1. Not sure what I am doing wrong, this is the code I am testing. Sorry for the mess... just testing at the moment :P
Beta Was this translation helpful? Give feedback.
All reactions