Google Cloud PubSub: Previously valid subscription suddenly unauthorized

那年仲夏 提交于 2019-12-05 10:51:10

I was facing the same issue and finally found the solution. The issue was google token getting expired and thus the pubsub subscriber throwing the exception. There was already a bug in github for a similar oauth issue. (Link)

The issue was fixed in node-pubsub version 0.20.0 and upgrading to this version will fix your issue. The actual fix was in google-auth-library-nodejs version 2.0 and node-pubsub:v0.20.0 uses google-auth-library-nodejs:2.0.

From github release notes of google-auth-library-nodejs:2.0:

The OAuth2.refreshAccessToken method has been deprecated. The getAccessToken, getRequestMetadata, and request methods will all refresh the token if needed automatically. There is no need to ever manually refresh the token.

Hope this helps !!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!