personalcapital: PC API login/auth errors starting 11/17/2021
Starting ~2d ago (17-NOV), started getting these Personal Capital API login/auth errors…
% ./wx.ad.py ro
Traceback (most recent call last):
File "./wx.ad.py", line 60, in <module>
pc.login( pc_cred_user , pc_cred_pass ) ;
File "/usr/local/lib/python3.4/site-packages/personalcapital/personalcapital.py", line 44, in login
raise Exception()
Exception
…on code from this library that has run flawlessly for well over a year…
34 def login(self, username, password):
35 initial_csrf = self.__get_csrf_from_home_page(base_url)
36 csrf, auth_level = self.__identify_user(username, initial_csrf)
37
38 if csrf and auth_level:
39 self.__csrf = csrf
40 if auth_level != AuthLevelEnum.USER_REMEMBERED:
41 raise RequireTwoFactorException()
42 self.__authenticate_password(password)
43 else:
44 raise Exception()
Is anyone else experiencing this and/or have a fix/workaround? Tried disabling 2FA, no dice. Have logged a support case with PC but not holding my breath.
Thanks! Ian
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 4
- Comments: 21
Looks like update in cloudflare, a small homepage structure change, and API payloads. My solution here (new dependency added, cloudscraper): pull request #21
I wonder if @haochi would be willing to assign ownership of this repo to another dev so that we could add this fix?
Was about to come here and make a similar pull request! Thanks for making this. For those coming along trying to fix this for themselves, run the following (assuming you’re using requirements.txt):
Note that there are breaking changes, such as
authenticate_passwordrequiring username now, so make sure to update your use of the library if you switch over.Thanks, @UnusualPi. I applied your fix and it resolved the login error issue on my end. I had to upgrade a couple of required package versions to make it fully work though. Thanks again for the solution!
Thanks @willyiwei - looks like I’m surviving reboots & all is well - thanks to all here for lending a hand.
@Aharic - thanks for the info - that did the trick. (I was close…) 😃
LOL … so took a wild guess that my old OpenBSD box where I host this script is just in some janky state – and so I ported the script to a very recently-created AWS EC2 instance.
*Good news: *no more pkg import errors 😃
Bad news: cloudscraper.exceptions.CloudflareChallengeError: Detected a Cloudflare version 2 Captcha challenge, This feature is not available in the opensource (free) version.
Is anyone else seeing this?
On Wed, Dec 1, 2021 at 10:05 AM Ian Van Hoven @.***> wrote: