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

Google subscription and refresh token issue #359

Open
pierroo opened this issue Feb 23, 2023 · 0 comments
Open

Google subscription and refresh token issue #359

pierroo opened this issue Feb 23, 2023 · 0 comments

Comments

@pierroo
Copy link

pierroo commented Feb 23, 2023

I am struggling to properly setup google verification of subscription.
I followed the docs to get the mandatory keys for iap.config:

googleAccToken: process.env.GOOGLE_ACC_TOKEN, // optional, for Google Play subscriptions
googleRefToken: process.env.GOOGLE_REF_TOKEN, // optional, for Google Play subscritions
googleClientID: process.env.GOOGLE_CLIENT_ID, // optional, for Google Play subscriptions
googleClientSecret: process.env.GOOGLE_CLIENT_SECRET, // optional, for Google Play subscriptions

I placed those access token and refresh token in .env file, and I got them from https://developers.google.com/oauthplayground as mentioned in the docs.

HOWEVER, the refresh token clearly expires every 3600 seconds.

I added it to my server (on heroku), it worked great for the first few days, and then a few hours ago all payments validation would crash with the following:

{"error":{},"status":1,"message":"{\"statusCode\":400,\"body\":{\"error\":\"invalid_grant\",\"error_description\":\"Token has been expired or revoked.\"}, ....

Whether consumable or subscription, the iap.validate will now always crash.
Of course when I manually regenerate the access and refresh token following the docs it will work again, but for how long??

Maybe I misunderstood, but instead of those expiring access and refresh token, is there any way to use a google service account instead?
I am not sure how this would work, the documentation may be outdated or vague about it.

Any help would be GREATLY appreciated!

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

1 participant