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

[BUG] Logging in with in-app browser fails with "This device sent too many requests." #495

Open
jbaiter opened this issue Dec 5, 2024 · 10 comments

Comments

@jbaiter
Copy link
Contributor

jbaiter commented Dec 5, 2024

Describe the bug
When trying to login to PSN via the new In-App WebView, The Login form errors out with "This device sent too many requests to the server. Please try again". This is an error returned by the PSN service and displayed in the login form itself.
The weird thing is that this happened for my first attempt at logging in, i.e. the first time Chiaki has interacted with PSN ever. Is it possible that there are hardcoded constants in the code that trigger some abuse detection routine on the Sony servers?

Debug Log
No log created since no stream session is opened.

To Reproduce
Steps to reproduce the behavior:

  1. Go to unregistered console in main view
  2. Click on 'PSN Login'
  3. Enter user and password, submit
  4. See error "This device sent too many requests."

Expected behavior
PSN Login is performed, PSN-ID and OAuth tokens are obtained and stored.

@streetpea
Copy link
Owner

@jbaiter that’s weird I didn’t get that error with the dev build. I can try with the flatpak build.

@streetpea
Copy link
Owner

@jbaiter does opening in an external browser work?

@streetpea
Copy link
Owner

streetpea commented Dec 5, 2024

Tested again and it still works fine for me with the 1.9.2 release version of the flatpak, not sure what’s causing it for you. I’ve gotten reports of others running into the issue today as well.

@jbaiter
Copy link
Contributor Author

jbaiter commented Dec 5, 2024

So I just tried in Desktop mode:

  • In-App Qt WebView: Same problem as in Game Mode
  • External Browser: Login succeeds/I am asked for my 2FA token

So it's very likely caused by one or more of the default headers set by the QtWebEngine 🤔 Maybe the User-Agent triggers some abuse detection on the PSN server in combination with user-specific stuff like the IP range the request originates from?

@streetpea
Copy link
Owner

streetpea commented Dec 5, 2024

@jbaiter hmm perhaps. I would assume I would be adding the same header as well though and it’s not flagging me. I guess maybe it depends on country as well...

@streetpea
Copy link
Owner

@jbaiter you can access the web console by running with
flatpak run --env=QTWEBENGINE_REMOTE_DEBUGGING=8080 io.github.streetpea.Chiaki4deck
and then opening your browser to localhost:8080 and compare the network requests for headers.

@streetpea
Copy link
Owner

@jbaiter can you try using the angelfish web browser from the discover store? That also uses qt webengine

@streetpea
Copy link
Owner

Probably related to this XenorPLxx/playnite-library-psn#32 as the auth goes through the sso cookie process

@streetpea
Copy link
Owner

@jbaiter I was able to reproduce this on one of my devices. Strangely, I used Angelfish and it worked fine. I also tried changing the user agent to other browsers that worked and it still had the issue so I guess it's not that.

@streetpea
Copy link
Owner

@jbaiter I tried again today and the error went away again. Maybe it has to do with load on Sony's servers?

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

No branches or pull requests

2 participants