-
Notifications
You must be signed in to change notification settings - Fork 3
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
Failed to Import Games from Playstation (authentication issues) #5
Comments
Hi! Some users had issues with authentication lately, so let's start with some basic checks:
Playnite should restart after that, and you should be able to try and authenticate again. If it doesn't help, then I'll try to prepare a debug version of the plugin to check what's exactly the problem. You can also upload extensions.log file (it's in menu → About Playnite → 'Other' tab → User data directory), maybe I'll find something there that'll shine more light on this issue. |
I followed the steps above and got the same error. If I follow the above link it advances to the 2 step verification but in playnite it does not get to that step. There was no token.json file to be deleted which seems to be the error that playnite is showing "token file does not exist." I'm about 90% sure that after uninstalling and reinstalling there was a token file before but one has not generated since. But in both cases I still could not authenticate. Thanks. |
Same issue, your advices don't work. |
I'm a bit time constrained at the moment, but I'll try to look into it as soon as I'm free. |
|
It's a new log after I was able to login to PSN but extension now get another error. |
@DRiBay here are the steps that @Dorennor discovered to fix it, I'm still unable to reproduce the error in my setup:
Then Dorennor got an error visible on the screenshots above, but after restart, the plugin magically started working. You can try the same to see if it works. |
Initially this still did not work for me. Looking at the screenshots from Dorennor above though I noticed that I had "Try to migrate games from the old plugin on the next library update" checked. I unchecked that and tried again and logged in fine without doing anything different. So now I can login as well but using a different method than Dorennor. |
One more logout but now I could login without problems. |
Same problem here, getting the "A connection to the server could not be established." error, but the url isn't working in the browser as well in my case. Just redirect to the main Playstation Store Page. |
I can confirm this works! Thanks! |
I have the smae issue : "A connection to the server could not be established." |
Just checking in to say that this worked for me, as well. If I were to guess, the issue was potentially created by the way Playnite's library backup (Library > Backup Library Data) works. I used it this past week when reinstalling Windows; after restoring the data, I found I could no longer log into PSN, encountering this error. Clearing the token and web cache has seemingly fixed the issue, at least for now. |
I keep getting the following error: "Failed to import games from PlayStation. Unexpected character encountered while parsing value: <. Path ", line 0, position 0." I'm authenticated. If I logout and login again, I have to click the "are you having trouble logging in" link, then the back button, at which point I can properly login. I've tried everything mentioned here, including deleting token.json and then clearing web cache. |
@finkleroy separate issue, got fixed in #6 |
Thanks. Sorry for posting it in the wrong place. |
Sadly, that didn't work for me. I can login on the link in my browser, but when I try from Playnite I get this. |
I tried this solution and it didn't work for me as well. After I restarted I got to the capcha screen, but after that it just showed me the same error. |
I am also running into the same, and apparently this has been an issue off and on for GOG and other plugin/browser extensions that hit the Sony site for various tasks. Here's a link on what appears to be the problem: FriendsOfGalaxy/galaxy-integration-psn#7 (comment) And a workaround from the GOG PSN plugin, which I can't find a facsimile in the Token.JSON this plugin uses: FriendsOfGalaxy/galaxy-integration-psn#7 (comment) TL;DR from the various threads I have been reading about the GOG plugin: "They say it's due to the embedded browser in Galaxy being old, which leads to a "CORS error". The reason it works sometimes is because if you luck out and get a direct connection to a PSN server, PSN's servers don't care about this issue and will let your request through. If your request goes to Akamai's load balanacer before PSN, Akamai's filters will throw the CORS error and reject your request." |
@MostDefiantly thanks for the info. Unfortunately, I was even able to cause that error on a clean Chrome 107 going through the main PlayStation website and manually clicking 'Sign in'. At this point, it seems like it's out of my hands and Sony has something set up incorrectly. TO RESOLVE THE ISSUE, follow the steps described here: #5 (comment). Sometimes it takes a few tries, but eventually goes through. |
workaround helped, but when i successfully log-in to Playstation website, it automatically refreshes and logs me off a second before closing the window and saying "Requires authentification" again in Configure Integrations window. is there any fix for this? |
The workaround doesn't work for me. I noticed, when logging in from sony's website, a captcha is shown, maybe tha captcha is expected and somehow the login throws an error if it misses it? |
@Shevraar @hksy46 a new version of the plugin has been released, available here https://github.com/XenorPLxx/playnite-library-psn/releases/tag/2.17 or in Playnite directly. The new version includes a new authentication method that goes around the problem. Thanks, @MostDefiantly, for pointing me to the right direction. |
for ppl still having issues with this. |
I tried the new authentication method yesterday, it worked just fine. When I booted everything up today, it gave me the error that it needed to reauthenticate, but when I went to follow the steps and log back in via the site on my browser, I was given a capture and then told Sony had locked my account and I need to change my password. Seems something about the new method was triggering a flag to lock the account. |
The new method isn't working for me neither the legacy method works.. I'm using chrome as default browser but tried also firefox.. I try to log from europe. I can put the npsso code but still isn't logging in |
The new method worked fine for me up until now, but it no longer works as of today. After I authenticate, it says, "Requires authentication". |
Same phenomenom here the Cookie Auth works ONCE for me every cookie change, had that 2-3 times yet. |
The plugin now longer works for me at all using both the cookie method and the legacy method. I've tried all the tricks; clearing cache and clicking "trouble signing in?" and then the back arrow and entering my password again. Nothing works. |
@WingedAsarath yea ive had my account locked once too, but didn't happen again, and i've re-logged many times during testing @nero81af @finkleroy @jedcooper - something changed relating to mobile APIs, try version 2.19 - should work now. |
Confirmed, I'm authenticated by cookie. At least for now :D |
No joy with version 2.20. Same thing. Log in, input NPSSO, "Requires Authentication" loop. Legacy doesn't work either. |
Was just on the GoG Galaxy thread for this, posting here in case it helps. Generally speaking, the approach of logging in on the user's browser of choice then copying the NPSSO manually works, but its cumbersome. I've seen other applications implement OAuth requests by opening the user's browser of choice and logging in there, then returning to the application with the authenticated results. I haven't fully read up on the PlayNite API (i have read the source code on this repo), but assuming it has the same integrated browser issue as GoG Galaxy, implementing this method would circumvent Akamai's nonsense. The only flaw i can see is the user would remain logged in on their browser; the integrated browsers have their own cookies and do not have this issue. Of course, this would be the case when they log in manually, but it's more obvious when you do it on your own that you should log out if desired. |
@BaumherA I don't believe I can just 'grab a cookie' from an external browser. I would be very unhappy, as a browser user, if that would be possible for a 3rd party app. |
Python's request library allows you to read cookies, though i think this is via a Get/Post request and their response. IIRC you can send cookies with a Post request, and any response can return cookies along with its regular data. This would of course require server-side code, so you are correct. Sony's API already does this, however, as it exposes the NPSSO cookie as plaintext JSON via (https://ca.account.sony.com/api/v1/ssocookie). You can do a simple Get request on that URL and parse the response as JSON. It will be a Key/Value pair or Tuple (if successful), or empty/an error (if not). As for the OAuth, an example of doing that externally can be seen at https://stackoverflow.com/questions/36719540/how-can-i-get-an-oauth2-access-token-using-python. However, we (GoG currently, your legacy method) don't really do true OAuth - we don't provide any client ids or secrets, and we also don't ask for a response. Even if we wanted to, Sony's API isn't documented so i don't think we could. Instead, we provide a URL to go to on success and failure. I believe we could take advantage of that success URL to redirect back to the app. Simply have a webpage that has javascript that does a get request on Sony's NPSSO Cookie API, then redirect back to the app with the response. Admittedly, i do not know how to redirect back to the app as of writing this. Perhaps along a port on the localhost? I'm wondering if we could bundle that webpage with the extension, and store/run it locally. This may require running a localhost as a web server, which i have done before using python, but i don't know how resource intensive that would get. Also worth noting, PlayNite uses C#, and i have not looked for any equivalent Nuget Packages to do the same as the python libraries. All things considered i much prefer C# but am originally coming at this from GoG so i've been looking at python instead. |
Here's Google's API Documentation for OAuth from desktop. https://developers.google.com/identity/protocols/oauth2/native-app . I'm going to see if i can get a demo working in C# of an app that can communicate Sony's login stuff, albeit without any of the PlayNite integration. I'll get back to you in a bit. If you would prefer, i can use Telgram/Discord/Skype/Slack (etc) to bounce code ideas. |
Well, this is a lot rougher than i was expecting. Afaik, the post success url is ignored, so that option is out. I suppose you could try getting Sony to allow you access to their API so we could use the Redirect URI (which is how Google does it), but as it stands, most sites are blacklisted from that, so we can't use it either. another option i tried was to put the login page in an iframe, then detect when the page changes via OnLoad, but content security policy prevents that (it runs on a whitelist). if i can poke at their API long enough, i might find a way to go to a desired site on successful login, at which point all i'd need is a few lines of Javascript and be good to go. Google's sample documentation provides a really simple impementation via httplistener that you can send the npsso back to the application with. |
Yea, I kinda expected that and have chosen to pick my wins and not really invest even more time into trying to figure that out, but if you find a viable solution I'd be happy to help implement that back into PSN library plugin. |
In order for me to get this working, I ended up logging into PlayStation on Chrome and going to my profile and logging into the security section. Then, I went to playnite and click the link to go to the ssocookie page and the code popped up; this page usually would show an error instead of the code. I added the code and saved. Then updated the PSN library and it worked! |
So...no working solution in 2024. I tried the deleting cache, but it didn't work |
@Nio03 look up this post #22 (comment) Also, I know what year it is, no need to remind that. |
Side note, if https://ca.account.sony.com/api/v1/ssocookie gives you an error message of "HTTP Status 429 – Too Many Requests" instead of outputting the response details directly as text (this was happening across multiple web browsers for me):
Dunno how widespread this "HTTP Status 429 - Too Many Requests" issue is where the built-in instructions might warrant being updated to point people to using this (I think it could be more consistent in getting people their |
I'll try to write down some notes myself here https://github.com/XenorPLxx/playnite-library-psn?tab=readme-ov-file#http-status-429--too-many-requests, for now I've linked to this comment if you don't mind. Putting all the notes inside the plugin might make the window too big, linking it to this section should work. |
I get the following error message suddenly. "Failed to Import Games from Playstation. User is not authenticated: Token file does not exist." I'm on playnite 10.3. When I try to authenticate it says, "A connection to the server could not be established." I've tried several times over the past week. I'm removed and reinstalled the plugin. Is this something I can fix with a workaround or did it break with an update?
The text was updated successfully, but these errors were encountered: