gogpsn

GOG Galaxy PlayStation Network Connector Sign-in Workaround

As of the time of writing, the Playstation Network integration plugin for GOG Galaxy 2.0 fails to sign in for many people. After entering user credentials, users are presented with an error that The connection to the server timed out.

timeout

The cause of the timeout error has to do with a CORS error being returned during the authentication process with the PlayStation server which only seems to be occuring with the current version of the built-in GOG Galaxy browser.

It is reported that the fix for this issue is that the built-in browser needs to be updated to a newer version. GOG is supposedly aware of the issue and there is no current ETA for a fix. My guess is that there should be a fix with the next update of GOG Galaxy 2.0.

Until a fix is released for the issue in question, a workaround has been found by Bustacap, which this page details out with additional steps and images.

Workaround to Fix the Sign-in Timeout Issue

Backup

The very first step I would suggest is that you backup your current Galaxy folder in case things go wrong. If you follow the steps outlined in this guide, you should be fine.

  1. Open up the Run box (CTRL+R)
  2. Enter the following in the Run box:
    %LocalAppData%\GOG.com
    

    Then hit Ok

    backup1

  3. Backup the Galaxy folder. I backed it up just by archiving the whole folder using 7-zip.

    backup2

Preparing The GOG PlayStation Network Plugin

Here we will be making sure that the PlayStation Network is disconnected, and that an un-altered version of the plugin is installed.

  1. Exit GOG

    exit

  2. Open up the Run box (CTRL+R)
  3. Enter the following in the Run box:
    %LocalAppData%\GOG.com\Galaxy\plugins\installed\
    

    Then hit Ok

    plugins1

  4. If present, delete the psn_{random-id} folder.

    plugins2

  5. Launch GOG.
  6. Open up the Settings => Integration page.

    settings

    You should see a Connect button for PlayStation Network. However, if you were previously signed into the PlayStation Network, you could be seeing a Connecting status for the connector.

    connecting

    If you have a stuck Connecting state:

    • Exit GOG

      exit

    • Relaunch GOG
    • Navigate to the Settings => Integrations page.
    • If you see either Connected or Offline, then click Disconnect.

      connected

      offline

  7. Ensure that you are disconnected:

    disconnected

  8. To download the PSN plugin again, click Connect.

    downloading

  9. When the confirmation dialog comes up, click Cancel.

    modal

  10. Exit GOG

    exit

Modifying the PlayStation Network Plug-in With Your NPSSO Token

At this point, you should now have a clean version of the PSN plugin installed and disconnected. The next steps will cover manually editing the plugin with your NPSSO token which you will retrieve from your Playstation Store account.

  1. Open up the Run box (CTRL+R)
  2. Enter the following in the Run box:
    %LocalAppData%\GOG.com\Galaxy\plugins\installed\
    

    Then hit Ok

    plugins1

  3. Open the psn_{random-id} folder.

    plugins2

    plugins3

  4. Edit plugin.py in your editor of choice. I use Visual Studio Code.

Now here comes the fun part. We now have the plugin.py file open in our editor. The next steps will go over how to obtain the NPSSO token that we will be inserting into the file.

  1. Make sure you have the latest version of Mozilla Firefox, Google Chrome or the new Chromium-based Microsoft Edge browser installed before continuing.

    It has been reported that Google Chrome version 74 experiences this issue where Sony’s authorization fails due to a CORS bug. This is why it is STRONGLY recommended to update your browsers to the latest version.

  2. Open up a new browser window

    new

  3. Navigate to https://store.playstation.com

    store_sign

  4. Sign in to the PlayStation Store

    store_sso

    store_auth

    NB! Keep this tab open once signed in to keep the session active for the workaround to work

  5. Open a new tab and navigate to https://ca.account.sony.com/api/v1/ssocookie

    NB! This tab should also be kept open to keep the session active for the workaround to work

    You should see the following:

    npsso

    If you see this error instead:

    error

    {"error":"invalid_grant","error_description":"Invalid login","error_code":20,"docs":"https://auth.api.sonyentertainmentnetwork.com/docs/","parameters":[]}
    
  6. Copy the 64-character NPSSO token along with the quotes.
  7. DO NOT CLOSE YOUR BROWSER
  8. Go back to your editor where you have plugin.py open.
  9. Go to line 64 in plugin.py.

    code1

  10. Replace the last word None on line 64 with your NPSSO Token

    The NPSSO token has to be surrounded by “quotes”

    After editing line 64, it should look something like this:

    code3

    !NB: DO NOT CHANGE ANY OTHER LINE EXEPT LINE 64

  11. Save plugin.py.

  12. Launch GOG.
  13. Connect to the PlayStation Network.

    disconnected

  14. When the confirmation dialog pops up, click Connect.

    modal

There you have it. That should be all you need to connect to your PlayStation Store Account.

connected

Troubleshooting Offline Status

Some of you might come across an error where it shows as Offline when you try connect to your PlayStation account, even after doing all these steps.

offline

This is the result of your NPSSO token expiring before you finished up. You took too long to edit the plugin and now you need a new token.

  1. Disconnect from PlayStation Netowrk.
  2. Go back to the PlayStation Store tab in your browser, which you should still have open from previous steps. Sign-in to https://store.playstation.com. If you’re already signed in, sign out, and sign in again.
  3. Switch to the https://ca.account.sony.com/api/v1/ssocookie tab, which also should still be open from previous steps. Refresh your page to get a new token (CTRL+F5).
  4. NB! Keep both these tabs open to ensure that the workaround works
  5. Copy the token.
  6. DO NOT CLOSE YOUR BROWSER
  7. Replace your NPSSO token in plugin.py with the new token and save.
  8. Exit GOG.
  9. Relaunch GOG.
  10. Try connecting again.

I hope that this fixes the connection issues for most