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

exchangeRefreshTokenForAuthTokens not returning new refresh_token as stated in documentation #171

Open
Neppelenbroek opened this issue Oct 12, 2024 · 2 comments

Comments

@Neppelenbroek
Copy link

Neppelenbroek commented Oct 12, 2024

I'm trying to get a new refresh token without having to use my npsso token. I was hoping that exchangeRefreshTokenForAuthTokens would do this as the description of this function in the documentation makes me think it should.

This function lets you exchange your refresh token retrieved from your initial log in for a set of new access and refresh tokens. By using this function, you no longer need to constantly retrieve a new NPSSO.

Unfortunately, it returns the refresh token I use to make the call, and the "refresh_token_expires_in" property doesn't reset so it keeps counting down. Can I only get a new refresh_token once the current one has expired, or is this function broken?

I'm looking for something that returns a new refresh token without the need of my npsso. Basically I want to keep my authentication valid as long as possible instead of having to login to playstation.com every 2 months.

@wescopeland
Copy link
Member

is this function broken?

In order to rapidly respond to breaking changes, psn-api is intentionally low-level. The function is a very thin wrapper around direct API calls to PSN itself, with little to no magic within.

I'm looking for something that returns a new refresh token without the need of my npsso. Basically I want to keep my authentication valid as long as possible instead of having to login to playstation.com every 2 months.

That is indeed desirable. To the best of my knowledge, no public-facing endpoint exists for this purpose. However, if one does exist, I'd be happy to add it.

@Neppelenbroek
Copy link
Author

Alright, makes sense. Perhaps an idea to update the documentation for this part: https://psn-api.achievements.app/api-docs/authentication#exchangerefreshtokenforauthtokens as it let me to believe that there's a way to keep your 'session' alive without the need for your npsso token. If I understand correctly, the maximum time to keep a live connection with the API is 2 months before you'll need a new npsso token?

thanks in advance :)

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

2 participants