alphapapa / pocket-lib.el

Emacs library for the getpocket.com API
GNU General Public License v3.0
21 stars 5 forks source link

Does authorization work with Mozilla accounts? #8

Closed cbilson closed 3 months ago

cbilson commented 3 months ago

Several months ago, I switched from a normal email/password based account with getpocket.com to a firefox account (I can't remember if I did this voluntarily or not - it would be out of character for me, so maybe it was forced?) I believe pocket-reader was still working for me after that, up until about 3 weeks ago, when I repaved my machine.

Now, when I pocket-lib-reset-auth, approve in the browser, then try to launch pocket-reader again, I get an error saying it is unable to access the token:

condition-case: pocket-lib--access-token: Unable to get access token: (plz-http-error "HTTP error" #s(plz-error nil #s(plz-response 1.1 403 ((content-type . "text/html; charset=UTF-8") (content-length . "13") (connection . "keep-alive") (date . "Tue, 02 Jul 2024 18:51:38 GMT") (server . "Apache/2.4.52 (Debian)") (set-cookie . "PHPSESSID=***; path=/; HttpOnly") (x-frame-options . "SAMEORIGIN") (x-error . "User rejected code.") (x-error-code . "158") (status . "403 Forbidden") (cache-control . "private") (x-source . "Pocket") (set-cookie . "AUTH_BEARER_default=***; expires=Tue, 02-Jul-2024 19:51:38 GMT; Max-Age=3600; path=/; HttpOnly") (p3p . "policyref=\"/w3c/p3p.xml\", CP=\"ALL CURa ADMa DEVa OUR IND UNI COM NAV INT STA PRE\"") (x-cache . "Error from cloudfront") (via . "1.1 c49d4b2e85b9056f8bd472959e93032c.cloudfront.net (CloudFront)") (x-amz-cf-pop . "SEA900-P3") (x-amz-cf-id . "***")) "403 Forbidden") nil))

Inspired by this comment, tried logging out (which is what reminded me I had switched to a Firefox account), logged back in again, but I still got the same error as above.

I thought of trying to create a new, non-firefox account, to see if that was the issue, but it doesn't look like that is even possible anymore: image

I tried some other work arounds I saw in other issues (downgrading pocket-lib and pocket-reader, re-evaling them, evaling plz, ...) but keep getting the error above.

Has anyone else had issues with Firefox accounts or is it just me, or me barking up the wrong tree? Any other information I can provide or debugging I can do to fix this? Thanks in advance for any information.

alphapapa commented 3 months ago

As far as I know, it should work. The API documentation doesn't even mention Mozilla accounts, so I guess it shouldn't matter. https://getpocket.com/developer/docs/authentication

My usual suggestion would be to try to reproduce the problem in a clean Emacs configuration using https://github.com/alphapapa/with-emacs.sh

cbilson commented 3 months ago

Thanks! I tried with-emacs.sh, installed pocket-reader, authorized the app, but got the same error as before.

I'll try investigating this further.

alphapapa commented 3 months ago

That's disappointing to hear. If you have time, please try v0.2 of pocket-lib (e.g. use quelpa-use-package to install it from git); I don't think that should make any difference, but I'm curious.

If that doesn't help, then I'm afraid that fixing it will require stepping through the code carefully, something I just don't have time for right now, so help would be appreciated.

alphapapa commented 3 months ago

By the way, I note in the error you reported: (x-error . "User rejected code.") (x-error-code . "158") and (x-cache . "Error from cloudfront"). I don't know what those mean, but they're likely relevant.

alphapapa commented 3 months ago

@cbilson FYI, this should be fixed by https://github.com/alphapapa/pocket-lib.el/commit/21f69179ad254ab64cb876115719e5d7d043f88d I tried using my Mozilla/Firefox account and it works for me.

cbilson commented 3 months ago

Thanks, @alphapapa ! Confirmed, that fixed it. Thanks again!