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 · 17 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?

@streetpea
Copy link
Owner

After talking with @streamingdv about this I believe it's just an issue with the PlayStation network as it seems to be an intermittent error and I did replicate it on other browsers and switching to a different broswer seemed to fix it. For example, switching to a different qwebengine version seemed to fix it when it happened on one qwebengine version but it later happened on that version and switching back to the old version temporarily fixed it.

@lazerwalker
Copy link

lazerwalker commented Jan 17, 2025

As a single data point, I ran into this issue just now, using latest Flathub chiaki on a Steam Deck. Happened consistently in the in-app browser, even if I waited five minutes between attempts, and then as soon as I switched to using Chrome as an external browser it worked first try. I can't prove the issue exists in the in-app browser rather than it being atmospheric noise on Sony's end, but it does seem suspect to me.

@lazerwalker
Copy link

Slight follow-up: I accidentally closed out of the Chrome window before I could successfully paste the code in, so I had to log in again. Once again, the embedded browser failed to login, maybe 1-2 minutes after Chrome worked, and then within 30 seconds of the embedded browser erroring out I was able to log in via Chrome perfectly fine.

@streetpea
Copy link
Owner

streetpea commented Jan 17, 2025

@lazerwalker yes it can do that because it’s blocking that specific browser for you. The thing is it does the same thing in reverse as well. Blocks chrome but allows the in app browser for other users or even the same user at different times

@bugfi5h
Copy link

bugfi5h commented Jan 19, 2025

I tried 2 (Chrome, Firefox) Browsers and the embedded one. Even copied the url to a browser on a different PC. Same result everywhere. Can't log in at all.
I am using the flathub version: 1.9.4

@streetpea
Copy link
Owner

streetpea commented Jan 19, 2025

@bugfi5h unfortunately this is an issue with the Sony site that also occurs with the official remote play app but seems to be device based. So trying on a different device usually works if another browser doesn’t. Trying again later usually also works.

@streetpea
Copy link
Owner

streetpea commented Jan 21, 2025

@bugfi5h I would recommend trying on a different device such as a phone and copying and pasting it to the Steam Deck if you can't get it to work on the Steam Deck. Sony's site for this is just garbage and unfortunately there is nothing I can do about it. It even breaks on the PlayStation portal. It's seemingly random so it breaks for some users on some devices and then works later on those same devices and then sometimes breaks on different devices with different browsers. I've found if it's blocking me using a vpn or disconnecting from a vpn can help.

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

4 participants