Closed DRiBay closed 1 year ago
Hi!
Some users had issues with authentication lately, so let's start with some basic checks:
make sure that you can log in from your browser on the same device using the same URL that plugin uses: https://web.np.playstation.com/api/session/v1/signin?redirect_uri=https://io.playstation.com/central/auth/login%3FpostSignInURL=https://www.playstation.com/home%26cancelURL=https://www.playstation.com/home&smcid=web:pdc
then, got to Add-ons menu [F9], Installed → Libraries → PlayStation, click 'Data folder' on the right and delete 'token.json' file if it exists
then, go to the setting menu [F4], Advanced and click 'Clear web cache'
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.
extensions.log
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.
I'm a bit time constrained at the moment, but I'll try to look into it as soon as I'm free.
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:
I've tried to login, got same error, press "Trouble with login?", press arrow button (previous page) and maximized window(I don't think that it matters but I want to deal all my actions) and in this window I've tried login one more time and it worked for me.
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.
@DRiBay here are the steps that @Dorennor discovered to fix it, I'm still unable to reproduce the error in my setup:
I've tried to login, got same error, press "Trouble with login?", press arrow button (previous page) and maximized window(I don't think that it matters but I want to deal all my actions) and in this window I've tried login one more time and it worked for me.
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.
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.
- make sure that you can log in from your browser on the same device using the same URL that plugin uses: https://web.np.playstation.com/api/session/v1/signin?redirect_uri=https://io.playstation.com/central/auth/login%3FpostSignInURL=https://www.playstation.com/home%26cancelURL=https://www.playstation.com/home&smcid=web:pdc
- then, got to Add-ons menu [F9], Installed → Libraries → PlayStation, click 'Data folder' on the right and delete 'token.json' file if it exists
- then, go to the setting menu [F4], Advanced and click 'Clear web cache'
I can confirm this works! Thanks!
I have the smae issue : "A connection to the server could not be established." I tried the 2 solutions : clear token and cache ; click on "Trouble with login". Unfortunately none of them worked.
Hi!
Some users had issues with authentication lately, so let's start with some basic checks:
- make sure that you can log in from your browser on the same device using the same URL that plugin uses: https://web.np.playstation.com/api/session/v1/signin?redirect_uri=https://io.playstation.com/central/auth/login%3FpostSignInURL=https://www.playstation.com/home%26cancelURL=https://www.playstation.com/home&smcid=web:pdc
- then, got to Add-ons menu [F9], Installed → Libraries → PlayStation, click 'Data folder' on the right and delete 'token.json' file if it exists
- then, go to the setting menu [F4], Advanced and click 'Clear web cache'
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.
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
@finkleroy separate issue, got fixed in #6
Thanks. Sorry for posting it in the wrong place.
Hi!
Some users had issues with authentication lately, so let's start with some basic checks:
- make sure that you can log in from your browser on the same device using the same URL that plugin uses: https://web.np.playstation.com/api/session/v1/signin?redirect_uri=https://io.playstation.com/central/auth/login%3FpostSignInURL=https://www.playstation.com/home%26cancelURL=https://www.playstation.com/home&smcid=web:pdc
- then, got to Add-ons menu [F9], Installed → Libraries → PlayStation, click 'Data folder' on the right and delete 'token.json' file if it exists
- then, go to the setting menu [F4], Advanced and click 'Clear web cache'
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.
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.
Hi!
Some users had issues with authentication lately, so let's start with some basic checks:
- make sure that you can log in from your browser on the same device using the same URL that plugin uses: https://web.np.playstation.com/api/session/v1/signin?redirect_uri=https://io.playstation.com/central/auth/login%3FpostSignInURL=https://www.playstation.com/home%26cancelURL=https://www.playstation.com/home&smcid=web:pdc
- then, got to Add-ons menu [F9], Installed → Libraries → PlayStation, click 'Data folder' on the right and delete 'token.json' file if it exists
- then, go to the setting menu [F4], Advanced and click 'Clear web cache'
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 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.
Just to emphasize for visibility, the workaround that has been successful for others and me is the one Dorennor listed. Click the TROUBLE SIGNING IN? at the bottom, then click the ARROW to the left of Sony to go back to the login screen. Attached photo to illustrate exactly which arrow.
Just to emphasize for visibility, the workaround that has been successful for others and me is the one Dorennor listed. Click the TROUBLE SIGNING IN? at the bottom, then click the ARROW to the left of Sony to go back to the login screen. Attached photo to illustrate exactly which arrow.
worked for me !
Just to emphasize for visibility, the workaround that has been successful for others and me is the one Dorennor listed. Click the TROUBLE SIGNING IN? at the bottom, then click the ARROW to the left of Sony to go back to the login screen. Attached photo to illustrate exactly which arrow.
Funny enough, when I tried to login again (wanting it to error out again before clicking Trouble signing in?) it working as it should.
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: https://github.com/FriendsOfGalaxy/galaxy-integration-psn/issues/7#issuecomment-644759063
And a workaround from the GOG PSN plugin, which I can't find a facsimile in the Token.JSON this plugin uses: https://github.com/FriendsOfGalaxy/galaxy-integration-psn/issues/7#issuecomment-645286024
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: https://github.com/XenorPLxx/playnite-library-psn/issues/5#issuecomment-1288236965. 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? edit: seems like it's country-wide issue (Russia). unfortunate
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. npsso didn't authenticate for me, kept going back to requires auth. legacy gave server errors what worked for me, I put in the npsso key, hit save, opened the settings again, then click authenticate on the bottom by the legacy method and it worked.
I'm getting mixed messages. Updating the library shows me this:
Then I go to the addon settings and see this, instead:
If I clear the text on the input field, and check again, I get a "requires authentication" message, as expected, but then I use THE SAME token as before, and I get this:
Then I went into my browser to log out but the thing is I wasn't logged in!
Seems like https://ca.account.sony.com/api/v1/ssocookie
tells me I'm logged in, but not active? Then I clicked "sign in" and I didn't even need to input my credentials, because as you can guess, the cookie was authenticated:
The token didn't change, as I was already logged in.
So now I manually closed my playstation session to get a new token, and the token URI gives me this message saying I don't have a cookie:
{"error":"invalid_grant","error_description":"Invalid login","error_code":20,"docs":"https://auth.api.sonyentertainmentnetwork.com/docs/","parameters":[]}
Then I continued to input my credentials, OTP, puzzle, and "save these credentials" checked. Now I get a new token...
It seems to work, now to update the library...
So now I think "Ok, the new method doesn't work, I'll try the legacy one". I click on the "Authenticate" button but the window just disappears.
Then I check again if deleting the token from the field works, and...
So now I really don't know what else to do :|
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. After that - no cookie change, but can't authenticate by cookie anymore - I'm only able to manually login by the legacy method.
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.
@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. You've probably seen apps redirecting back from a browser with a prompt that 'this page wants to open this app', but that's something that both sides have to code in (application and the website). This might be possible with some custom browser extension, but that'd be a lot of work for a small improvement. Can you show any examples of OAuth requests opening the user's browser of choice?
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 https://github.com/XenorPLxx/playnite-library-psn/issues/22#issuecomment-2227230237 For me, using private/incognito browser works.
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):
https://ca.account.sony.com
.)
npsso
cookie in the list and copy the value for that cookie (double-clicking the value column for that cookie entry allows you to select & copy the value.)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 npsso
value so it might just help avoid a potential pitfall, but it is a bit more involved than using the npsso
if it happens to be output directly via that webpage if others happen still get that.)
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?