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

API error when trying to auth. #23

Closed
Wisperer opened this issue Feb 28, 2022 · 4 comments
Closed

API error when trying to auth. #23

Wisperer opened this issue Feb 28, 2022 · 4 comments
Labels
retired Not relevant (CmX API retired)

Comments

@Wisperer
Copy link

{"response": {"challenge": {"challenge_reason": "AuthenticationFailed", "uri": "https://www.amazon.com/ap/challenge?arb=14c7afd4-2ad6-4249-8564-cb60fb081415", "required_authentication_method": "GenericClaimPassword"}}, "request_id": "0825dd8f55734e85b7f3a0d7af1a62c2"}
Traceback (most recent call last):
  File "/home/fletcher/comix/comix.py", line 142, in <module>
    cmx = Cmx(None)
  File "/home/fletcher/comix/comix.py", line 23, in __init__
    self.auth_token = amazon_api.login(config.EMAIL, config.PASSWORD)["access_token"]
TypeError: 'NoneType' object is not subscriptable

Known good password and email. Works fine with an older version of the script.

Ran with `python comix.py list' after adding account info to config.py

@WorkingJB
Copy link

I suspect this is due to the site shifting from comixology to read.kindle.com, and the headers still referencing comixology.comics.

@kenzitwasntme2 kenzitwasntme2 mentioned this issue Apr 16, 2022
@KaHooli
Copy link

KaHooli commented Apr 26, 2022

I'm running this on a brand new install of Ubunutu 22.04 LTS with only the following have been run...

sudo apt update; sudo apt dist-upgrade; sudo apt upgrade; sudo apt autoremove
sudo apt install vim git python3-pip
git clone https://github.com/athrowaway2021/comix
cd comix
pip install -r requirements.txt

I then added my details to config.py and tried to run the script. I found I needed to run pip install xmltodict to get the script to run. I then tried again and got the same message as OP.

Getting auth token . . .
{"response": {"challenge": {"challenge_reason": "HandleOnWebView", "uri": "https://www.amazon.com/ap/challenge?arb=<removed>"}}, "request_id": "<removed>"}
Traceback (most recent call last):
  File "/home/james/comix/comix.py", line 142, in <module>
    cmx = Cmx(None)
  File "/home/james/comix/comix.py", line 23, in __init__
    self.auth_token = amazon_api.login(config.EMAIL, config.PASSWORD)["access_token"]
TypeError: 'NoneType' object is not subscriptable

@comment-account
Copy link

Try going to Amazon.com in your web browser, logging out of your account, and then logging back on again. I think this following line is the clue:

{"response": {"challenge": {"challenge_reason": "HandleOnWebView", "uri": "https://www.amazon.com/ap/challenge?arb="}}, "request_id": ""}

What happened for me is that I needed to respond to a prompt that it is actually me trying to login. You can't get at that prompt using the script, but it appears reconfirming in the web browser that you are you is enough so that it stops happening in the script. I generally use Linux but loaded the script in Windows and I ran into this exact situation. Once I confirmed things in the browser, the script worked fine.

@athrowaway2021
Copy link
Owner

The above reply is correct, 3309195 adds a message that tells users with 2FA to relogin in browser if this issue occurs.

@athrowaway2021 athrowaway2021 added the retired Not relevant (CmX API retired) label Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
retired Not relevant (CmX API retired)
Projects
None yet
Development

No branches or pull requests

5 participants