如何获得谷歌网站pipe理员API访问令牌(Node.js)
我需要访问令牌提交站点地图。 我用这样的护照
passport.authenticate('googleApi', {scope: ['profile', 'https://www.googleapis.com/auth/webmasters']});
并得到
{ code: '4/aEzOOw1j-1rNCXCVajylMVRasdo2Kasdreisasdradk.MijA9hPKsg8WYFZr95uasdUzab8UkwI' }
在request.query中
但是这个令牌根据无效
https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=MY_TOKEN
提前致谢。
您获得的代码是授权码。 您必须通过交换授权码来获得访问令牌。 阅读oauth 2.0authentication