Skip to content

Bugfixes to handle changes to Personal Capital CSRF token parsing#24

Open
hammem wants to merge 2 commits intohaochi:masterfrom
hammem:master
Open

Bugfixes to handle changes to Personal Capital CSRF token parsing#24
hammem wants to merge 2 commits intohaochi:masterfrom
hammem:master

Conversation

@hammem
Copy link
Copy Markdown

@hammem hammem commented Jul 3, 2022

Fixes to get login working again for this API.

  • updated regex parsing of the CSRF token
  • change the user-agent header to get through Cloudflare filtering
  • raise useful exceptions to aid in future debugging
  • set device name to Personal Capital Python API, to make identifying session in the account easier

Mark Hammell and others added 2 commits July 3, 2022 16:42
Adds methods for saving and loading a session, to avoid having to
authenticate each time the API is used in a new execution, kernel
instance, etc.  Both the session cookies and CSRF token are stored to a
file via Python's bulit-in pickling.

Both methods take a file name param, to define where the data should be
written or read.
@hammem
Copy link
Copy Markdown
Author

hammem commented Jul 20, 2022

@haochi , are you able to review this PR? PersonalCapital made some slight changes to how they store the CSRF token that prevents the API currently in master from functioning.

@deanjgoldman
Copy link
Copy Markdown

@hammem Did you ever run into an authenticate_password error: "Authorization required."? Not exactly sure what to do with it. I don't have 2FA. On __identify_user() I am getting back a "USER_IDENTIFIED" auth_level, not a "USER_REMEMBERED". Wondering if there's a simple explanation. Ty!

@Dabnsky
Copy link
Copy Markdown

Dabnsky commented Nov 18, 2022

just wanted to add feedback about how this branch resolved my issues. I had to go reset my password to get my account unlocked before it would work.

@mjm2z
Copy link
Copy Markdown

mjm2z commented Nov 23, 2022

@deanjgoldman @hammem I'm having the same issue with auth_level = USER_IDENTIFIED instead of USER_REMEMBERED, any ideas?

@konecnyna
Copy link
Copy Markdown

The lib was broken the last 1-2 weeks for me. This branch fixed it.

I'm wondering what will happen when/if "empower" full takes over the domain and page. The domain is still personalcapital for now.

@ChocoTonic
Copy link
Copy Markdown

ChocoTonic commented Jul 7, 2025

Hi,

Since this repo seems to be unmaintained, I've forked it here:
https://github.com/ChocoTonic/empower_personal_capital

Please feel free to open PRs there. Thanks to everyone who's contributed and kept the discussion going.

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.

6 participants