achievements-app/psn-api

Getting 403 when trying to exchange NPSSO for access code

Closed this issue · 2 comments

Hi, I'm trying to just run the first 3 lines of code to obtain your access token and refresh token, and am receiving a 403 on the call for exchangeNpssoForCode. I followed another example for obtaining it in powershell and that worked fine, so I don't believe it's an issue with the PSN account or NPSSO.

Does anyone have any ideas? I can't find any info on the api documentation in general or why this response is coming. I'm trying to run this from a web application in a browser.

Thank you

Hi @TheMleeOfMlees,

This issue is occurring because your browser is throwing a CORS error on the request. Sony has a strict CORS policy which modern browsers will honor. You will likely need to perform your fetches server-side in an API endpoint, than have your client call your API endpoint(s).

@wescopeland thanks, assumed that was the case but hoped it wasn't. The lack of sony's documentation on their api made this questionable to me. I'm now setting up an express node api that can fetch the data per request, I appreciate your help with this friend, I really appreciate your response.