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

403 Client error when trying to add user #121

Open
Yummiii opened this issue Sep 27, 2024 · 22 comments
Open

403 Client error when trying to add user #121

Yummiii opened this issue Sep 27, 2024 · 22 comments
Labels
needs_reproduction Steps to reproduce bug are unclear.

Comments

@Yummiii
Copy link

Yummiii commented Sep 27, 2024

Before you open an issue
Please make sure you've upgraded to the latest version of kobodl on pypi or docker. Also read through the troubleshooting guide. Try running with --debug enabled and see what comes up in the debug log.

Do not erase this template, it's here to help you.

Describe the issue
When trying to add a new user with ./kobodl-ubuntu user add or with the webui on docker, it fails with requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://authorize.kobo.com/signin?returnUrl=http://kobo.com/&wsa=Kobo&pwsav=8.11.24971&pwspid=00000000-0000-0000-0000-000000004000&pwsdid=2852a229-f8c0-4006-8836-ca8590a96de6

To Reproduce
Steps to reproduce the behavior:

  1. Execute the command to add a new user
  2. Input the credentials
  3. Copy captcha from the site
  4. See error

Expected behavior
A new user being added

Screenshots
Screenshot from 2024-09-27 19-11-27

Desktop (please complete the following information):

  • OS: Linux - Fedroa 40
  • Install method and python version: latest pre-built bundle, Python 3.12.6
  • Kobodl Version: 0.9.3
@Yummiii Yummiii added the bug Something isn't working label Sep 27, 2024
@BakaUshi
Copy link

getting the same error for the past 2 weeks also - tried various methods (.exe, running via python command line, using the web server) and issue occurs with all of them.
I recall seeing some news about changes coming to the Kobo desktop app, so possibly some back-end athentication changes were made. I can't find specific details about it, but this recent blog post mentions some updates to the apps: https://www.kobo.com/blog/kobos-summer-2024-update-on-new-features-and-fixes

@geekylou
Copy link

I wonder if this is related to #118 (comment) which I think is caused by cloudflare blocking urllib.

@jajpater
Copy link

Same problem here.

@BakaUshi
Copy link

BakaUshi commented Oct 26, 2024

didn't work still get 403 with this code:

# response = self.Session.post(signInUrl, data=postData)
scraper = cloudscraper.create_scraper() 
response= scraper.post(signInUrl, data=postData)

@subdavis
Copy link
Owner

subdavis commented Oct 29, 2024

I cannot reproduce this bug.

@subdavis subdavis added needs_reproduction Steps to reproduce bug are unclear. and removed bug Something isn't working labels Oct 29, 2024
@LordAsaki
Copy link

Same problem here with the Windows build.

@AudioAnchorite
Copy link

Is it possibly related to the browser? Is it intended to be used on Chrome, when we are using FireFox, LibreWolf, or Brave?

@LordAsaki
Copy link

Is it possibly related to the browser? Is it intended to be used on Chrome, when we are using FireFox, LibreWolf, or Brave?

I tried Firefox, Edge, and Chrome; they all worked the same.

@subdavis
Copy link
Owner

subdavis commented Oct 29, 2024

No, this is not related to browser, nor will the behavior differ between builds (pip, windows, docker). If you're getting a 403, your account is somehow being treated differently by kobo servers than mine is. Do you all have proper kobo accounts?

You must have a kobo email login. See "I can't log in" in the troubleshooting section for how to workaround this requirement.

@LordAsaki
Copy link

Mine is an email login.

@subdavis
Copy link
Owner

I made a brand new account. I got a 403 the first time I tried to log in with the new account. I tried a second time with debug enabled and it succeeded. I tried a third time with debug disabled and it succeeded.

I don't really know why this would be.

@LordAsaki
Copy link

No luck here yet. Tried a new account, tried with and without --debug, tried with and without --captcha, tried with and without admin privileges...
Hopefully it can be figured out, I just bought an audiobook today and wanted to throw it on my MP3 player =)

@AudioAnchorite
Copy link

AudioAnchorite commented Oct 30, 2024

No, this is not related to browser, nor will the behavior differ between builds (pip, windows, docker). If you're getting a 403, your account is somehow being treated differently by kobo servers than mine is. Do you all have proper kobo accounts?

You must have a kobo email login. See "I can't log in" in the troubleshooting section for how to workaround this requirement.

Yep, switched to email login when I found this package some time ago. Downloaded many an EPUB before this issue. I installed 24H2 a few days ago as well, which is how I discovered the problem.

@alex1299
Copy link

alex1299 commented Oct 31, 2024

Same here. It has been working for about a year, and even now, running
"kobodl-windows.exe book list " still shows me a list of my books. However, I can't retrieve any audiobooks—only ePub files seem to work.
So, I started from scratch with the latest version, using: "kobodl-windows.exe user add" but I encountered the same issue:
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://authorize.kobo.com/signin?returnUrl=http://kobo.com/&wsa=Kobo&pwsav=8.11.2
4971&.....

@matteo-l
Copy link

matteo-l commented Nov 2, 2024

I get the 403 error if I try to add a user with the docker image (kobodl 0.9.3) on debian 12 and a 500 error with the pip install (kobodl 0.9.3 and 0.9.4) on ubuntu 20.04. If I start the latter with the debug option I get the following text in debug.log

2024-11-02 14:28:32.756812
['/home/matteo/.local/bin/kobodl', '--debug', 'user', 'add']
2024-11-02 14:29:36.821706
AuthenticateDevice
{"ResponseStatus":{"ErrorCode":"BadRequestException","Message":"Device authentication requests should not contain an Authentication header."}}

On ubuntu kobodl 0.9.3 worked fine a few weeks ago.

I'm in Italy, I don't know if it matters.

@heluq
Copy link

heluq commented Nov 7, 2024

I am in spain, same issues File "kobodl_main_.py", line 5, in
File "click\core.py", line 829, in call
File "click\core.py", line 782, in main
File "click\core.py", line 1259, in invoke
File "click\core.py", line 1259, in invoke
File "click\core.py", line 1066, in invoke
File "click\core.py", line 610, in invoke
File "click\decorators.py", line 33, in new_func
File "kobodl\commands\user.py", line 80, in add
File "kobodl\actions.py", line 169, in Login
File "kobodl\kobo.py", line 455, in Login
File "kobodl\kobo.py", line 145, in __GetExtraLoginParameters
File "requests\models.py", line 1024, in raise_for_status
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://authorize.kobo.com/signin?returnUrl=http://kobo.com/&wsa=Kobo&pwsav=xxxxx
[PYI-4556:ERROR] Failed to execute script 'main' due to unhandled exception!

@WinterBaas
Copy link

WinterBaas commented Nov 10, 2024

I get the same error. Tried it with two different accounts. Any solution?

@lubomir-brindza
Copy link

Hitting this as well; I've dumped the contents of the 403 response body to https://ext.halka.sk/challenge.html - looks like some extra JS-based validation/redirection; excerpt here:

<title>Challenged | Kobo.com</title>
...
<div class="section"><center><div>
    <p id="cf-spinner-please-wait"></p>
    <p id="cf-spinner-redirecting" style="display:none"></p>
</div>
<noscript><h1>Please turn JavaScript on and reload the page.</h1></noscript>
<div id="no-cookie-warning" style="display:none"><p>Please enable Cookies and reload the page.</p></div>
<form id="challenge-form"></form>
<script>(function(){window._cf_chl_opt={cvId: '3',cZone: "authorize.kobo.com",cType: 'managed',cRay: '8e1e1b95fe776e91',cH: ...

@leela1255
Copy link

This one is also happening to me (along with the 403 on certain ebooks and audiobooks). Got a new machine and now I can't add a user to download my latest crop of books.

@Hillbillyer
Copy link

I have tried running Kobodl on both Ubuntu and Docker and I am getting the same error. I'm using the latest stable version for both.

This is the error from my Ubuntu attempt:

Traceback (most recent call last):
 File "kobodl/__main__.py", line 5, in <module>
  File "click/core.py", line 829, in __call__
  File "click/core.py", line 782, in main
  File "click/core.py", line 1259, in invoke
  File "click/core.py", line 1259, in invoke
  File "click/core.py", line 1066, in invoke
  File "click/core.py", line 610, in invoke
  File "click/decorators.py", line 33, in new_func
  File "kobodl/commands/user.py", line 80, in add
  File "kobodl/actions.py", line 169, in Login
  File "kobodl/kobo.py", line 455, in Login
  File "kobodl/kobo.py", line 145, in __GetExtraLoginParameters
  File "requests/models.py", line 1024, in raise_for_status
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://authorize.kobo.com/signin?returnUrl=http://kobo.com/&wsa=Kobo&pwsav=8.11.24971&pwspid=00000000-0000-0000-0000-000000004000&pwsdid=ff57ce8b-75a4-42f4-b82a-0a1899f2648d
[PYI-28208:ERROR] Failed to execute script '__main__' due to unhandled exception!

My Docker error was essentially the same.
Hope this is helpful.

@RikPabbruwee
Copy link

I'm still getting the 403 Client Error: Forbidden for url error, wouldn't it be possible to add an other method of adding a user?

@jajpater
Copy link

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_reproduction Steps to reproduce bug are unclear.
Projects
None yet
Development

No branches or pull requests