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

Polestar: Change authentication flow to deny cookies #17276

Merged
merged 8 commits into from
Nov 16, 2024

Conversation

loebse
Copy link
Contributor

@loebse loebse commented Nov 15, 2024

Fix #17186

I took the liberty to create a PR to implement the changes discussed in #17186 and #17252 to speed up the process 😉

Main change is to check for the uid and then deny the cookies using confirmConsentAndGetCode

I was able to successfully test this with my Polestar 2

@loebse
Copy link
Contributor Author

loebse commented Nov 15, 2024

@rostbeule / @scyomantion / @andig

As mentioned above, I was able to make it run with the following code. Please let me know what you think!

@rostbeule
Copy link

rostbeule commented Nov 15, 2024

Nice, I had the same thought earlier. You're capturing both values before and avoid passing param into the function directly. That would have caused issues in my case. I like this approach.

In my view, my PR is obsolete then. I did mention somewhere that I wouldn't have time for it until Sunday. The sun isn't shining anyway =D

@andig
Copy link
Member

andig commented Nov 16, 2024

I've lost track. Does this now work as-is?

vehicle/polestar/identity.go Outdated Show resolved Hide resolved
vehicle/polestar/identity.go Outdated Show resolved Hide resolved
vehicle/polestar/identity.go Outdated Show resolved Hide resolved
vehicle/polestar/identity.go Outdated Show resolved Hide resolved
vehicle/polestar/identity.go Outdated Show resolved Hide resolved
@loebse
Copy link
Contributor Author

loebse commented Nov 16, 2024

Thanks for your comments @andig
I have incorporated the changes and verified it is working fine with my P2.

@loebse loebse requested a review from andig November 16, 2024 15:08
@andig andig merged commit 47af893 into evcc-io:master Nov 16, 2024
@andig
Copy link
Member

andig commented Nov 16, 2024

Great, thank you!

@loebse loebse deleted the Polestar-fix-authentication branch November 21, 2024 10:53
mabunixda added a commit to mabunixda/evcc that referenced this pull request Nov 22, 2024
* master: (58 commits)
  Add Huawei EMMA (evcc-io#17338)
  Config UI: device value formatting (evcc-io#17258)
  chore: upgrade npm dependencies (evcc-io#17344)
  chore: fix template
  Easee: fix PhaseGetter returning used, not configured, phases  (evcc-io#17326)
  chore: refactor
  MacOS: add gobuildid
  Script: simplify setters
  Tariffs: formula, charges, tax > advanced fields (evcc-io#17301)
  Push: add custom messenger (BC) (evcc-io#17211)
  Script: add missing string setter (evcc-io#17314)
  Sofar: fix docs (evcc-io#17324)
  Polestar: skip test
  Polestar: fix authentication (evcc-io#17276)
  chore: fix line breaks
  chore: fix quotes
  Add Tessie (evcc-io#17274)
  PUN: update api endpoint (evcc-io#17270)
  Revert "EM24: add pv usage & fix energy (evcc-io#17173)"
  Enphase: fix soc
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vehicles Specific vehicle support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OAuth2 Login Fails Due to Missing code Parameter in Polestar API - Requires Additional Consent Handling
3 participants